This commit adds support for code generation of options with modes (enums). From now on option enums can be specified in the corresponding *.toml files without the need of extra code. All option enums are now in the options namespace.
- ccache -z
- ${CC} --version
- ${CXX} --version
+ - sudo pip install toml
- |
echo "travis_fold:start:load_script"
normal="$(echo -e '\033[0m')" red="$normal$(echo -e '\033[01;31m')" green="$normal$(echo -e '\033[01;32m')"
- [CMake >= 3.1](https://cmake.org)
- [GNU Bash](https://www.gnu.org/software/bash/)
- [Python >= 2.7](https://www.python.org)
+ + module [toml](https://pypi.org/project/toml/)
- [GMP v4.2 (GNU Multi-Precision arithmetic library)](https://gmplib.org)
- [libantlr3c v3.2 or v3.4 (ANTLR parser generator C support library)](http://www.antlr3.org/)
- [Java >= 1.6](https://www.java.com)
${INCLUDE_INSTALL_DIR}/cvc4/expr)
install(FILES
options/argument_extender.h
- options/arith_heuristic_pivot_rule.h
- options/arith_propagation_mode.h
- options/arith_unate_lemma_mode.h
- options/datatypes_modes.h
options/language.h
options/option_exception.h
options/options.h
options/printer_modes.h
- options/quantifiers_modes.h
options/set_language.h
- options/smt_modes.h
- options/sygus_out_mode.h
- options/theoryof_mode.h
DESTINATION
${INCLUDE_INSTALL_DIR}/cvc4/options)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/SWIGTYPE_p_CVC4__Model.java
${CMAKE_CURRENT_BINARY_DIR}/SWIGTYPE_p_CVC4__Printer.java
${CMAKE_CURRENT_BINARY_DIR}/SWIGTYPE_p_CVC4__api__Solver.java
- ${CMAKE_CURRENT_BINARY_DIR}/SWIGTYPE_p_InstFormatMode.java
+ ${CMAKE_CURRENT_BINARY_DIR}/SWIGTYPE_p_CVC4__options__InstFormatMode.java
${CMAKE_CURRENT_BINARY_DIR}/SWIGTYPE_p_LemmaChannels.java
${CMAKE_CURRENT_BINARY_DIR}/SWIGTYPE_p_Listener.java
${CMAKE_CURRENT_BINARY_DIR}/SWIGTYPE_p_ListenerCollection__Registration.java
#include "decision/decision_attributes.h"
#include "decision/justification_heuristic.h"
#include "expr/node.h"
-#include "options/decision_mode.h"
#include "options/decision_options.h"
#include "options/smt_options.h"
Trace("decision-init") << " * options->decisionStopOnly: "
<< options::decisionStopOnly() << std::endl;
- if(options::decisionMode() == decision::DECISION_STRATEGY_INTERNAL) { }
- if(options::decisionMode() == decision::DECISION_STRATEGY_JUSTIFICATION) {
+ if (options::decisionMode() == options::DecisionMode::JUSTIFICATION)
+ {
ITEDecisionStrategy* ds =
new decision::JustificationHeuristic(this, d_userContext, d_satContext);
enableStrategy(ds);
DecisionWeight JustificationHeuristic::getWeightPolarized(TNode n, bool polarity)
{
- if(options::decisionWeightInternal() != DECISION_WEIGHT_INTERNAL_USR1) {
+ if (options::decisionWeightInternal()
+ != options::DecisionWeightInternal::USR1)
+ {
return getWeight(n);
}
DecisionWeight JustificationHeuristic::getWeight(TNode n) {
if(!n.hasAttribute(DecisionWeightAttr()) ) {
+ options::DecisionWeightInternal combiningFn =
+ options::decisionWeightInternal();
- DecisionWeightInternal combiningFn = options::decisionWeightInternal();
-
- if (combiningFn == DECISION_WEIGHT_INTERNAL_OFF || n.getNumChildren() == 0)
+ if (combiningFn == options::DecisionWeightInternal::OFF
+ || n.getNumChildren() == 0)
{
if (options::decisionRandomWeight() != 0)
{
Random::getRandom().pick(0, options::decisionRandomWeight()-1));
}
}
- else if (combiningFn == DECISION_WEIGHT_INTERNAL_MAX)
+ else if (combiningFn == options::DecisionWeightInternal::MAX)
{
DecisionWeight dW = 0;
for (TNode::iterator i = n.begin(); i != n.end(); ++i)
dW = max(dW, getWeight(*i));
n.setAttribute(DecisionWeightAttr(), dW);
}
- else if (combiningFn == DECISION_WEIGHT_INTERNAL_SUM
- || combiningFn == DECISION_WEIGHT_INTERNAL_USR1)
+ else if (combiningFn == options::DecisionWeightInternal::SUM
+ || combiningFn == options::DecisionWeightInternal::USR1)
{
DecisionWeight dW = 0;
for (TNode::iterator i = n.begin(); i != n.end(); ++i)
${type_properties_includes}
-#line 36 "${template}"
+#line 35 "${template}"
namespace CVC4 {
namespace kind {
getterCommands.emplace_back(new GetProofCommand());
}
- if (d_options.getDumpInstantiations() &&
- ((d_options.getInstFormatMode() != INST_FORMAT_MODE_SZS &&
- (res.asSatisfiabilityResult() == Result::SAT ||
- (res.isUnknown() && res.whyUnknown() == Result::INCOMPLETE))) ||
- res.asSatisfiabilityResult() == Result::UNSAT)) {
+ if (d_options.getDumpInstantiations()
+ && ((d_options.getInstFormatMode() != options::InstFormatMode::SZS
+ && (res.asSatisfiabilityResult() == Result::SAT
+ || (res.isUnknown()
+ && res.whyUnknown() == Result::INCOMPLETE)))
+ || res.asSatisfiabilityResult() == Result::UNSAT))
+ {
getterCommands.emplace_back(new GetInstantiationsCommand());
}
+# Check if the toml Python module is installed.
+execute_process(
+ COMMAND
+ ${PYTHON_EXECUTABLE} -c "import toml"
+ RESULT_VARIABLE
+ RET_TOML
+ ERROR_QUIET
+)
+
+if(RET_TOML)
+ message(FATAL_ERROR
+ "Could not find Python module toml. Install via `pip install toml'.")
+endif()
+
libcvc4_add_sources(
argument_extender.h
argument_extender_implementation.cpp
argument_extender_implementation.h
- arith_heuristic_pivot_rule.cpp
- arith_heuristic_pivot_rule.h
- arith_propagation_mode.cpp
- arith_propagation_mode.h
- arith_unate_lemma_mode.cpp
- arith_unate_lemma_mode.h
base_handlers.h
- bool_to_bv_mode.cpp
- bool_to_bv_mode.h
- bv_bitblast_mode.cpp
- bv_bitblast_mode.h
- datatypes_modes.h
- decision_mode.cpp
- decision_mode.h
decision_weight.h
didyoumean.cpp
didyoumean.h
options_public_functions.cpp
printer_modes.cpp
printer_modes.h
- quantifiers_modes.cpp
- quantifiers_modes.h
set_language.cpp
set_language.h
- smt_modes.cpp
- smt_modes.h
- strings_modes.cpp
- strings_modes.h
- sygus_out_mode.h
- theoryof_mode.cpp
- theoryof_mode.h
- ufss_mode.h
)
set(options_toml_files
+++ /dev/null
-/********************* */
-/*! \file arith_heuristic_pivot_rule.cpp
- ** \verbatim
- ** Top contributors (to current version):
- ** Morgan Deters, Tim King
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief [[ Add one-line brief description here ]]
- **
- ** [[ Add lengthier description here ]]
- ** \todo document this file
- **/
-
-#include "options/arith_heuristic_pivot_rule.h"
-
-namespace CVC4 {
-
-std::ostream& operator<<(std::ostream& out, ErrorSelectionRule rule) {
- switch(rule) {
- case MINIMUM_AMOUNT:
- out << "MINIMUM_AMOUNT";
- break;
- case VAR_ORDER:
- out << "VAR_ORDER";
- break;
- case MAXIMUM_AMOUNT:
- out << "MAXIMUM_AMOUNT";
- break;
- default:
- out << "ArithHeuristicPivotRule!UNKNOWN";
- }
-
- return out;
-}
-
-}/* CVC4 namespace */
+++ /dev/null
-/********************* */
-/*! \file arith_heuristic_pivot_rule.h
- ** \verbatim
- ** Top contributors (to current version):
- ** Tim King, Morgan Deters
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief [[ Add one-line brief description here ]]
- **
- ** [[ Add lengthier description here ]]
- ** \todo document this file
- **/
-
-#include "cvc4_public.h"
-
-#ifndef CVC4__THEORY__ARITH__ARITH_HEURISTIC_PIVOT_RULE_H
-#define CVC4__THEORY__ARITH__ARITH_HEURISTIC_PIVOT_RULE_H
-
-#include <iostream>
-
-namespace CVC4 {
-
-enum ErrorSelectionRule {
- VAR_ORDER,
- MINIMUM_AMOUNT,
- MAXIMUM_AMOUNT,
- SUM_METRIC
-};
-
-std::ostream& operator<<(std::ostream& out, ErrorSelectionRule rule) CVC4_PUBLIC;
-
-}/* CVC4 namespace */
-
-#endif /* CVC4__THEORY__ARITH__ARITH_HEURISTIC_PIVOT_RULE_H */
category = "regular"
long = "unate-lemmas=MODE"
type = "ArithUnateLemmaMode"
- default = "ALL_PRESOLVE_LEMMAS"
- handler = "stringToArithUnateLemmaMode"
- includes = ["options/arith_unate_lemma_mode.h"]
+ default = "ALL"
read_only = true
help = "determines which lemmas to add before solving (default is 'all', see --unate-lemmas=help)"
+ help_mode = "Unate lemmas are generated before SAT search begins using the relationship of constant terms and polynomials."
+[[option.mode.ALL]]
+ name = "all"
+ help = "A combination of inequalities and equalities."
+[[option.mode.EQUALITY]]
+ name = "eqs"
+ help = "Outputs lemmas of the general forms (= p c) implies (<= p d) for c < d, or (= p c) implies (not (= p d)) for c != d."
+[[option.mode.INEQUALITY]]
+ name = "ineqs"
+ help = "Outputs lemmas of the general form (<= p c) implies (<= p d) for c < d."
+[[option.mode.NO]]
+ name = "none"
[[option]]
name = "arithPropagationMode"
long = "arith-prop=MODE"
type = "ArithPropagationMode"
default = "BOTH_PROP"
- handler = "stringToArithPropagationMode"
- includes = ["options/arith_propagation_mode.h"]
read_only = true
help = "turns on arithmetic propagation (default is 'old', see --arith-prop=help)"
+ help_mode = "This decides on kind of propagation arithmetic attempts to do during the search."
+[[option.mode.NO_PROP]]
+ name = "none"
+[[option.mode.UNATE_PROP]]
+ name = "unate"
+ help = "Use constraints to do unate propagation."
+[[option.mode.BOUND_INFERENCE_PROP]]
+ name = "bi"
+ help = "(Bounds Inference) infers bounds on basic variables using the upper and lower bounds of the non-basic variables in the tableau."
+[[option.mode.BOTH_PROP]]
+ name = "both"
+ help = "Use bounds inference and unate."
+
+
# The maximum number of difference pivots to do per invocation of simplex.
# If this is negative, the number of pivots done is the number of variables.
long = "error-selection-rule=RULE"
type = "ErrorSelectionRule"
default = "MINIMUM_AMOUNT"
- handler = "stringToErrorSelectionRule"
- includes = ["options/arith_heuristic_pivot_rule.h"]
read_only = true
help = "change the pivot rule for the basic variable (default is 'min', see --pivot-rule help)"
+ help_mode = "This decides on the rule used by simplex during heuristic rounds for deciding the next basic variable to select."
+[[option.mode.MINIMUM_AMOUNT]]
+ name = "min"
+ help = "The minimum abs() value of the variable's violation of its bound."
+[[option.mode.VAR_ORDER]]
+ name = "varord"
+ help = "The variable order."
+[[option.mode.MAXIMUM_AMOUNT]]
+ name = "max"
+ help = "The maximum violation the bound."
+[[option.mode.SUM_METRIC]]
+ name = "sum"
# The number of pivots before simplex rechecks every basic variable for a conflict
[[option]]
+++ /dev/null
-/********************* */
-/*! \file arith_propagation_mode.cpp
- ** \verbatim
- ** Top contributors (to current version):
- ** Morgan Deters
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief [[ Add one-line brief description here ]]
- **
- ** [[ Add lengthier description here ]]
- ** \todo document this file
- **/
-
-#include "options/arith_propagation_mode.h"
-
-namespace CVC4 {
-
-std::ostream& operator<<(std::ostream& out, ArithPropagationMode mode) {
- switch(mode) {
- case NO_PROP:
- out << "NO_PROP";
- break;
- case UNATE_PROP:
- out << "UNATE_PROP";
- break;
- case BOUND_INFERENCE_PROP:
- out << "BOUND_INFERENCE_PROP";
- break;
- case BOTH_PROP:
- out << "BOTH_PROP";
- break;
- default:
- out << "ArithPropagationMode!UNKNOWN";
- }
-
- return out;
-}
-
-}/* CVC4 namespace */
+++ /dev/null
-/********************* */
-/*! \file arith_propagation_mode.h
- ** \verbatim
- ** Top contributors (to current version):
- ** Morgan Deters, Tim King
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief [[ Add one-line brief description here ]]
- **
- ** [[ Add lengthier description here ]]
- ** \todo document this file
- **/
-
-#include "cvc4_public.h"
-
-#ifndef CVC4__THEORY__ARITH__ARITH_PROPAGATION_MODE_H
-#define CVC4__THEORY__ARITH__ARITH_PROPAGATION_MODE_H
-
-#include <iostream>
-
-namespace CVC4 {
-
-enum ArithPropagationMode {
- NO_PROP,
- UNATE_PROP,
- BOUND_INFERENCE_PROP,
- BOTH_PROP
-};
-
-std::ostream& operator<<(std::ostream& out, ArithPropagationMode rule) CVC4_PUBLIC;
-
-}/* CVC4 namespace */
-
-#endif /* CVC4__THEORY__ARITH__ARITH_PROPAGATION_MODE_H */
+++ /dev/null
-/********************* */
-/*! \file arith_unate_lemma_mode.cpp
- ** \verbatim
- ** Top contributors (to current version):
- ** Morgan Deters
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief [[ Add one-line brief description here ]]
- **
- ** [[ Add lengthier description here ]]
- ** \todo document this file
- **/
-
-#include "options/arith_unate_lemma_mode.h"
-
-namespace CVC4 {
-
-std::ostream& operator<<(std::ostream& out, ArithUnateLemmaMode mode) {
- switch(mode) {
- case NO_PRESOLVE_LEMMAS:
- out << "NO_PRESOLVE_LEMMAS";
- break;
- case INEQUALITY_PRESOLVE_LEMMAS:
- out << "INEQUALITY_PRESOLVE_LEMMAS";
- break;
- case EQUALITY_PRESOLVE_LEMMAS:
- out << "EQUALITY_PRESOLVE_LEMMAS";
- break;
- case ALL_PRESOLVE_LEMMAS:
- out << "ALL_PRESOLVE_LEMMAS";
- break;
- default:
- out << "ArithUnateLemmaMode!UNKNOWN";
- }
-
- return out;
-}
-
-}/* CVC4 namespace */
+++ /dev/null
-/********************* */
-/*! \file arith_unate_lemma_mode.h
- ** \verbatim
- ** Top contributors (to current version):
- ** Morgan Deters
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief [[ Add one-line brief description here ]]
- **
- ** [[ Add lengthier description here ]]
- ** \todo document this file
- **/
-
-#include "cvc4_public.h"
-
-#ifndef CVC4__THEORY__ARITH__ARITH_UNATE_LEMMA_MODE_H
-#define CVC4__THEORY__ARITH__ARITH_UNATE_LEMMA_MODE_H
-
-#include <iostream>
-
-namespace CVC4 {
-
-typedef enum {
- NO_PRESOLVE_LEMMAS,
- INEQUALITY_PRESOLVE_LEMMAS,
- EQUALITY_PRESOLVE_LEMMAS,
- ALL_PRESOLVE_LEMMAS
-} ArithUnateLemmaMode;
-
-std::ostream& operator<<(std::ostream& out, ArithUnateLemmaMode rule) CVC4_PUBLIC;
-
-}/* CVC4 namespace */
-
-#endif /* CVC4__THEORY__ARITH__ARITH_UNATE_LEMMA_MODE_H */
+++ /dev/null
-/********************* */
-/*! \file bool_to_bv_mode.cpp
- ** \verbatim
- ** Top contributors (to current version):
- ** Makai Mann
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** [[ Add lengthier description here ]]
-
- ** \todo document this file
-
-**/
-
-#include "options/bool_to_bv_mode.h"
-
-#include <iostream>
-
-
-namespace CVC4
-{
- std::ostream& operator<<(std::ostream& out, preprocessing::passes::BoolToBVMode mode) {
- switch(mode) {
- case preprocessing::passes::BOOL_TO_BV_OFF:
- out << "BOOL_TO_BV_OFF";
- break;
- case preprocessing::passes::BOOL_TO_BV_ITE:
- out << "BOOL_TO_BV_ITE";
- break;
- case preprocessing::passes::BOOL_TO_BV_ALL:
- out << "BOOL_TO_BV_ALL";
- break;
- default:
- out << "BoolToBVMode:UNKNOWN![" << unsigned(mode) << "]";
- }
-
- return out;
- }
-} // namespace CVC4
+++ /dev/null
-/********************* */
-/*! \file bool_to_bv_mode.h
- ** \verbatim
- ** Top contributors (to current version):
- ** Makai Mann
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** [[ Add lengthier description here ]]
-
- ** \todo document this file
-
-**/
-
-#include "cvc4_private.h"
-
-#ifndef CVC4__PREPROCESSING__PASSES__BOOL_TO_BV_MODE_H
-#define CVC4__PREPROCESSING__PASSES__BOOL_TO_BV_MODE_H
-
-#include <iosfwd>
-
-namespace CVC4 {
-namespace preprocessing {
-namespace passes {
-
-/** Enumeration of bool-to-bv modes */
-enum BoolToBVMode
-{
- /**
- * No bool-to-bv pass
- */
- BOOL_TO_BV_OFF,
-
- /**
- * Only lower bools in condition of ITEs
- * Tries to give more info to bit-vector solver
- * by using bit-vector-ITEs when possible
- */
- BOOL_TO_BV_ITE,
-
- /**
- * Lower every bool beneath the top layer to be a
- * bit-vector
- */
- BOOL_TO_BV_ALL
-};
-}
-}
-
-std::ostream& operator<<(std::ostream& out, preprocessing::passes::BoolToBVMode mode);
-
-}
-
-#endif /* CVC4__PREPROCESSING__PASSES__BOOL_TO_BV_MODE_H */
+++ /dev/null
-/********************* */
-/*! \file bv_bitblast_mode.cpp
- ** \verbatim
- ** Top contributors (to current version):
- ** Liana Hadarean, Alex Ozdemir
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief Bitblast modes for bit-vector solver.
- **
- ** Bitblast modes for bit-vector solver.
- **/
-
-#include "options/bv_bitblast_mode.h"
-
-#include <iostream>
-
-namespace CVC4 {
-
-std::ostream& operator<<(std::ostream& out, theory::bv::BitblastMode mode) {
- switch(mode) {
- case theory::bv::BITBLAST_MODE_LAZY:
- out << "BITBLAST_MODE_LAZY";
- break;
- case theory::bv::BITBLAST_MODE_EAGER:
- out << "BITBLAST_MODE_EAGER";
- break;
- default:
- out << "BitblastMode:UNKNOWN![" << unsigned(mode) << "]";
- }
-
- return out;
-}
-
-std::ostream& operator<<(std::ostream& out, theory::bv::BvSlicerMode mode) {
- switch(mode) {
- case theory::bv::BITVECTOR_SLICER_ON:
- out << "BITVECTOR_SLICER_ON";
- break;
- case theory::bv::BITVECTOR_SLICER_OFF:
- out << "BITVECTOR_SLICER_OFF";
- break;
- case theory::bv::BITVECTOR_SLICER_AUTO:
- out << "BITVECTOR_SLICER_AUTO";
- break;
- default:
- out << "BvSlicerMode:UNKNOWN![" << unsigned(mode) << "]";
- }
-
- return out;
-}
-
-std::ostream& operator<<(std::ostream& out, theory::bv::SatSolverMode solver) {
- switch(solver) {
- case theory::bv::SAT_SOLVER_MINISAT:
- out << "SAT_SOLVER_MINISAT";
- break;
- case theory::bv::SAT_SOLVER_CRYPTOMINISAT:
- out << "SAT_SOLVER_CRYPTOMINISAT";
- break;
- default:
- out << "SatSolverMode:UNKNOWN![" << unsigned(solver) << "]";
- }
-
- return out;
-}
-
-std::ostream& operator<<(std::ostream& out, theory::bv::BvProofFormat format)
-{
- switch (format)
- {
- case theory::bv::BITVECTOR_PROOF_ER: out << "BITVECTOR_PROOF_ER"; break;
- case theory::bv::BITVECTOR_PROOF_DRAT: out << "BITVECTOR_PROOF_DRAT"; break;
- case theory::bv::BITVECTOR_PROOF_LRAT: out << "BITVECTOR_PROOF_LRAT"; break;
- default: out << "BvProofFormat:UNKNOWN![" << unsigned(format) << "]";
- }
-
- return out;
-}
-
-std::ostream& operator<<(std::ostream& out,
- theory::bv::BvOptimizeSatProof level)
-{
- switch (level)
- {
- case theory::bv::BITVECTOR_OPTIMIZE_SAT_PROOF_NONE:
- out << "BITVECTOR_OPTIMIZE_SAT_PROOF_NONE";
- break;
- case theory::bv::BITVECTOR_OPTIMIZE_SAT_PROOF_PROOF:
- out << "BITVECTOR_OPTIMIZE_SAT_PROOF_PROOF";
- break;
- case theory::bv::BITVECTOR_OPTIMIZE_SAT_PROOF_FORMULA:
- out << "BITVECTOR_OPTIMIZE_SAT_PROOF_FORMULA";
- break;
- default: out << "BvOptimizeSatProof:UNKNOWN![" << unsigned(level) << "]";
- }
-
- return out;
-}
-
-}/* CVC4 namespace */
-
+++ /dev/null
-/********************* */
-/*! \file bv_bitblast_mode.h
- ** \verbatim
- ** Top contributors (to current version):
- ** Liana Hadarean, Alex Ozdemir, Mathias Preiner
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief Bitblasting modes for bit-vector solver.
- **
- ** Bitblasting modes for bit-vector solver.
- **/
-
-#include "cvc4_private.h"
-
-#ifndef CVC4__THEORY__BV__BITBLAST_MODE_H
-#define CVC4__THEORY__BV__BITBLAST_MODE_H
-
-#include <iosfwd>
-
-namespace CVC4 {
-namespace theory {
-namespace bv {
-
-/** Enumeration of bit-blasting modes */
-enum BitblastMode {
-
- /**
- * Lazy bit-blasting that separates boolean reasoning
- * from term reasoning.
- */
- BITBLAST_MODE_LAZY,
-
- /**
- * Bit-blast eagerly to the bit-vector SAT solver.
- */
- BITBLAST_MODE_EAGER
-};/* enum BitblastMode */
-
-/** Enumeration of bit-vector equality slicer mode */
-enum BvSlicerMode {
-
- /**
- * Force the slicer on.
- */
- BITVECTOR_SLICER_ON,
-
- /**
- * Slicer off.
- */
- BITVECTOR_SLICER_OFF,
-
- /**
- * Auto enable slicer if problem has only equalities.
- */
- BITVECTOR_SLICER_AUTO
-
-};/* enum BvSlicerMode */
-
-/** Enumeration of sat solvers that can be used. */
-enum SatSolverMode
-{
- SAT_SOLVER_MINISAT,
- SAT_SOLVER_CRYPTOMINISAT,
- SAT_SOLVER_CADICAL,
-}; /* enum SatSolver */
-
-/**
- * When the BV solver does eager bitblasting backed by CryptoMiniSat, proofs
- * can be written in a variety of formats.
- */
-enum BvProofFormat
-{
- /**
- * Write extended resolution proofs.
- */
- BITVECTOR_PROOF_ER,
- /**
- * Write DRAT proofs.
- */
- BITVECTOR_PROOF_DRAT,
- /**
- * Write LRAT proofs.
- */
- BITVECTOR_PROOF_LRAT,
-};
-
-/**
- * When the BV solver does eager bit-blasting backed by DRAT-producing SAT solvers, proofs
- * can be written in a variety of formats.
- */
-enum BvOptimizeSatProof
-{
- /**
- * Do not optimize the SAT proof.
- */
- BITVECTOR_OPTIMIZE_SAT_PROOF_NONE = 0,
- /**
- * Optimize the SAT proof, but do not shrink the formula
- */
- BITVECTOR_OPTIMIZE_SAT_PROOF_PROOF = 1,
- /**
- * Optimize the SAT proof and shrink the formula
- */
- BITVECTOR_OPTIMIZE_SAT_PROOF_FORMULA = 2,
-};
-
-
-}/* CVC4::theory::bv namespace */
-}/* CVC4::theory namespace */
-
-std::ostream& operator<<(std::ostream& out, theory::bv::BitblastMode mode);
-std::ostream& operator<<(std::ostream& out, theory::bv::BvSlicerMode mode);
-std::ostream& operator<<(std::ostream& out, theory::bv::SatSolverMode mode);
-std::ostream& operator<<(std::ostream& out, theory::bv::BvProofFormat format);
-std::ostream& operator<<(std::ostream& out, theory::bv::BvOptimizeSatProof level);
-
-}/* CVC4 namespace */
-
-#endif /* CVC4__THEORY__BV__BITBLAST_MODE_H */
name = "bvProofFormat"
category = "expert"
long = "bv-proof-format=MODE"
- type = "CVC4::theory::bv::BvProofFormat"
- default = "CVC4::theory::bv::BITVECTOR_PROOF_ER"
- handler = "stringToBvProofFormat"
- predicates = ["satSolverEnabledBuild"]
- includes = ["options/bv_bitblast_mode.h"]
+ type = "BvProofFormat"
+ default = "ER"
+ predicates = ["checkSatSolverEnabled<BvProofFormat>"]
help = "choose which UNSAT proof format to use, see --bv-sat-solver=help"
+ help_mode = "Bit-vector proof formats."
+[[option.mode.ER]]
+ name = "er"
+ help = "Extended Resolution, i.e. resolution with new variable definitions."
+[[option.mode.DRAT]]
+ name = "drat"
+ help = "Deletion and Resolution Asymmetric Tautology Additions."
+[[option.mode.LRAT]]
+ name = "lrat"
+ help = "DRAT with unit propagation hints to accelerate checking."
[[option]]
name = "bvOptimizeSatProof"
category = "expert"
long = "bv-optimize-sat-proof=MODE"
- type = "CVC4::theory::bv::BvOptimizeSatProof"
- default = "CVC4::theory::bv::BITVECTOR_OPTIMIZE_SAT_PROOF_FORMULA"
- handler = "stringToBvOptimizeSatProof"
- predicates = ["satSolverEnabledBuild"]
- includes = ["options/bv_bitblast_mode.h"]
+ type = "BvOptimizeSatProof"
+ default = "FORMULA"
+ predicates = ["checkSatSolverEnabled<BvOptimizeSatProof>"]
help = "enable SAT proof optimizations, see --bv-optimize-sat-proof=help"
+ help_mode = "SAT proof optimization level."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Do not optimize the SAT proof."
+[[option.mode.PROOF]]
+ name = "proof"
+ help = "Use drat-trim to shrink the SAT proof."
+[[option.mode.FORMULA]]
+ name = "formula"
+ help = "Use drat-trim to shrink the SAT proof and formula."
[[option]]
name = "bvSatSolver"
smt_name = "bv-sat-solver"
category = "expert"
long = "bv-sat-solver=MODE"
- type = "CVC4::theory::bv::SatSolverMode"
- default = "CVC4::theory::bv::SAT_SOLVER_MINISAT"
- handler = "stringToSatSolver"
- predicates = ["satSolverEnabledBuild"]
- includes = ["options/bv_bitblast_mode.h"]
+ type = "SatSolverMode"
+ default = "MINISAT"
+ predicates = ["checkBvSatSolver"]
help = "choose which sat solver to use, see --bv-sat-solver=help"
+ help_mode = "SAT solver for bit-blasting backend."
+[[option.mode.MINISAT]]
+ name = "minisat"
+[[option.mode.CRYPTOMINISAT]]
+ name = "cryptominisat"
+[[option.mode.CADICAL]]
+ name = "cadical"
[[option]]
name = "bitblastMode"
smt_name = "bitblast"
category = "regular"
long = "bitblast=MODE"
- type = "CVC4::theory::bv::BitblastMode"
- default = "CVC4::theory::bv::BITBLAST_MODE_LAZY"
- handler = "stringToBitblastMode"
- includes = ["options/bv_bitblast_mode.h"]
+ type = "BitblastMode"
+ default = "LAZY"
help = "choose bitblasting mode, see --bitblast=help"
+ help_mode = "Bit-blasting modes."
+[[option.mode.LAZY]]
+ name = "lazy"
+ help = "Separate boolean structure and term reasoning between the core SAT solver and the bit-vector SAT solver."
+[[option.mode.EAGER]]
+ name = "eager"
+ help = "Bitblast eagerly to bit-vector SAT solver."
[[option]]
name = "bitvectorAig"
name = "bitvectorEqualitySlicer"
category = "regular"
long = "bv-eq-slicer=MODE"
- type = "CVC4::theory::bv::BvSlicerMode"
- default = "CVC4::theory::bv::BITVECTOR_SLICER_OFF"
- handler = "stringToBvSlicerMode"
- includes = ["options/bv_bitblast_mode.h"]
+ type = "BvSlicerMode"
+ default = "OFF"
links = ["--bv-eq-solver"]
help = "turn on the slicing equality solver for the bit-vector theory (only if --bitblast=lazy)"
+ help_mode = "Bit-vector equality slicer modes."
+[[option.mode.ON]]
+ name = "on"
+ help = "Turn slicer on."
+[[option.mode.OFF]]
+ name = "off"
+ help = "Turn slicer off."
+[[option.mode.AUTO]]
+ name = "auto"
+ help = "Turn slicer on if input has only equalities over core symbols."
[[option]]
name = "bitvectorInequalitySolver"
smt_name = "bool-to-bv"
category = "regular"
long = "bool-to-bv=MODE"
- type = "CVC4::preprocessing::passes::BoolToBVMode"
- default = "CVC4::preprocessing::passes::BOOL_TO_BV_OFF"
- handler = "stringToBoolToBVMode"
- includes = ["options/bool_to_bv_mode.h"]
+ type = "BoolToBVMode"
+ default = "OFF"
help = "convert booleans to bit-vectors of size 1 at various levels of aggressiveness, see --bool-to-bv=help"
+ help_mode = "BoolToBV preprocessing pass modes."
+[[option.mode.OFF]]
+ name = "off"
+ help = "Don't push any booleans to width one bit-vectors."
+[[option.mode.ITE]]
+ name = "ite"
+ help = "Try to turn ITEs into BITVECTOR_ITE when possible. It can fail per-formula if not all sub-formulas can be turned to bit-vectors."
+[[option.mode.ALL]]
+ name = "all"
+ help = "Force all booleans to be bit-vectors of width one except at the top level. Most aggressive mode."
[[option]]
name = "bitwiseEq"
+++ /dev/null
-/********************* */
-/*! \file datatypes_modes.h
- ** \verbatim
- ** Top contributors (to current version):
- ** Andrew Reynolds
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief [[ Add one-line brief description here ]]
- **
- ** [[ Add lengthier description here ]]
- ** \todo document this file
- **/
-
-#include "cvc4_public.h"
-
-#ifndef CVC4__BASE__DATATYPES_MODES_H
-#define CVC4__BASE__DATATYPES_MODES_H
-
-#include <iostream>
-
-namespace CVC4 {
-namespace theory {
-
-enum SygusFairMode {
- /** enforce fairness by direct conflict lemmas */
- SYGUS_FAIR_DIRECT,
- /** enforce fairness by datatypes size */
- SYGUS_FAIR_DT_SIZE,
- /** enforce fairness by datatypes height bound */
- SYGUS_FAIR_DT_HEIGHT_PRED,
- /** enforce fairness by datatypes size bound */
- SYGUS_FAIR_DT_SIZE_PRED,
- /** do not use fair strategy for CEGQI */
- SYGUS_FAIR_NONE,
-};
-
-}/* CVC4::theory namespace */
-}/* CVC4 namespace */
-
-#endif /* CVC4__BASE__DATATYPES_MODES_H */
name = "sygusFair"
category = "regular"
long = "sygus-fair=MODE"
- type = "CVC4::theory::SygusFairMode"
- default = "CVC4::theory::SYGUS_FAIR_DT_SIZE"
- handler = "stringToSygusFairMode"
- includes = ["options/datatypes_modes.h"]
+ type = "SygusFairMode"
+ default = "DT_SIZE"
read_only = true
help = "if and how to apply fairness for sygus"
+ help_mode = "Modes for enforcing fairness for counterexample guided quantifier instantion."
+[[option.mode.DIRECT]]
+ name = "direct"
+ help = "Enforce fairness using direct conflict lemmas."
+[[option.mode.DT_SIZE]]
+ name = "dt-size"
+ help = "Enforce fairness using size operator."
+[[option.mode.DT_HEIGHT_PRED]]
+ name = "dt-height-bound"
+ help = "Enforce fairness by height bound predicate."
+[[option.mode.DT_SIZE_PRED]]
+ name = "dt-size-bound"
+ help = "Enforce fairness by size bound predicate."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Do not enforce fairness."
[[option]]
name = "sygusFairMax"
+++ /dev/null
-/********************* */
-/*! \file decision_mode.cpp
- ** \verbatim
- ** Top contributors (to current version):
- ** Morgan Deters
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief [[ Add one-line brief description here ]]
- **
- ** [[ Add lengthier description here ]]
- ** \todo document this file
- **/
-
-#include "options/decision_mode.h"
-
-#include <iostream>
-
-namespace CVC4 {
-
-std::ostream& operator<<(std::ostream& out, decision::DecisionMode mode) {
- switch(mode) {
- case decision::DECISION_STRATEGY_INTERNAL:
- out << "DECISION_STRATEGY_INTERNAL";
- break;
- case decision::DECISION_STRATEGY_JUSTIFICATION:
- out << "DECISION_STRATEGY_JUSTIFICATION";
- break;
- default:
- out << "DecisionMode:UNKNOWN![" << unsigned(mode) << "]";
- }
-
- return out;
-}
-
-}/* CVC4 namespace */
+++ /dev/null
-/********************* */
-/*! \file decision_mode.h
- ** \verbatim
- ** Top contributors (to current version):
- ** Kshitij Bansal, Morgan Deters, Tim King
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief [[ Add one-line brief description here ]]
- **
- ** [[ Add lengthier description here ]]
- ** \todo document this file
- **/
-
-#include "cvc4_private.h"
-
-#ifndef CVC4__SMT__DECISION_MODE_H
-#define CVC4__SMT__DECISION_MODE_H
-
-#include <iosfwd>
-
-namespace CVC4 {
-namespace decision {
-
-/** Enumeration of decision strategies */
-enum DecisionMode {
-
- /**
- * Decision engine doesn't do anything. Use sat solver's internal
- * heuristics
- */
- DECISION_STRATEGY_INTERNAL,
-
- /**
- * Use the justification heuristic
- */
- DECISION_STRATEGY_JUSTIFICATION,
-
- /**
- * Use may-relevancy.
- */
- DECISION_STRATEGY_RELEVANCY
-
-};/* enum DecisionMode */
-
-
-/** Enumeration of combining functions for computing internal weights */
-enum DecisionWeightInternal {
- DECISION_WEIGHT_INTERNAL_OFF,
- DECISION_WEIGHT_INTERNAL_MAX,
- DECISION_WEIGHT_INTERNAL_SUM,
- DECISION_WEIGHT_INTERNAL_USR1
-};/* enum DecisionInternalWeight */
-
-}/* CVC4::decision namespace */
-
-std::ostream& operator<<(std::ostream& out, decision::DecisionMode mode);
-
-}/* CVC4 namespace */
-
-#endif /* CVC4__SMT__DECISION_MODE_H */
smt_name = "decision-mode"
category = "regular"
long = "decision=MODE"
- type = "decision::DecisionMode"
- default = "decision::DECISION_STRATEGY_INTERNAL"
- handler = "stringToDecisionMode"
- includes = ["options/decision_mode.h"]
+ type = "DecisionMode"
+ default = "INTERNAL"
+ predicates = ["setDecisionModeStopOnly"]
help = "choose decision mode, see --decision=help"
+ help_mode = "Decision modes."
+[[option.mode.INTERNAL]]
+ name = "internal"
+ help = "Use the internal decision heuristics of the SAT solver."
+[[option.mode.JUSTIFICATION]]
+ name = "justification"
+ help = "An ATGP-inspired justification heuristic."
+[[option.mode.RELEVANCY]]
+ name = "justification-stoponly"
+ help = "Use the justification heuristic only to stop early, not for decisions."
[[option]]
name = "decisionStopOnly"
read_only = true
help = "use the weight nodes (locally, by looking at children) to direct recursive search"
+
[[option]]
name = "decisionRandomWeight"
category = "expert"
name = "decisionWeightInternal"
category = "expert"
long = "decision-weight-internal=HOW"
- type = "decision::DecisionWeightInternal"
- default = "decision::DECISION_WEIGHT_INTERNAL_OFF"
- handler = "stringToDecisionWeightInternal"
+ type = "DecisionWeightInternal"
+ default = "OFF"
read_only = true
- help = "computer weights of internal nodes using children: off, max, sum, usr1 (meaning evolving)"
+ help = "compute weights of internal nodes using children: off, max, sum, usr1"
+ help_mode = "Decision weight internal mode."
+[[option.mode.OFF]]
+ name = "off"
+[[option.mode.MAX]]
+ name = "max"
+[[option.mode.SUM]]
+ name = "sum"
+[[option.mode.USR1]]
+ name = "usr1"
import re
import sys
import textwrap
+import toml
### Allowed attributes for module/option/alias
MODULE_ATTR_REQ = ['id', 'name', 'header']
-MODULE_ATTR_ALL = MODULE_ATTR_REQ + ['options', 'aliases']
+MODULE_ATTR_ALL = MODULE_ATTR_REQ + ['option', 'alias']
OPTION_ATTR_REQ = ['category', 'type']
OPTION_ATTR_ALL = OPTION_ATTR_REQ + [
- 'name', 'help', 'smt_name', 'short', 'long', 'default', 'includes',
- 'handler', 'predicates', 'notifies', 'links', 'read_only', 'alternate'
+ 'name', 'help', 'help_mode', 'smt_name', 'short', 'long', 'default',
+ 'includes', 'handler', 'predicates', 'notifies', 'links', 'read_only',
+ 'alternate', 'mode'
]
ALIAS_ATTR_REQ = ['category', 'long', 'links']
return Options::current()->wasSetByUser(*this);
}}"""
+# Mode templates
+TPL_DECL_MODE_ENUM = \
+"""
+enum class {type}
+{{
+ {values}
+}};"""
+
+TPL_DECL_MODE_FUNC = \
+"""
+std::ostream&
+operator<<(std::ostream& out, {type} mode) CVC4_PUBLIC;"""
+
+TPL_IMPL_MODE_FUNC = TPL_DECL_MODE_FUNC[:-len(" CVC4_PUBLIC;")] + \
+"""
+{{
+ out << "{type}::";
+ switch(mode) {{{cases}
+ default:
+ Unreachable();
+ }}
+ return out;
+}}
+"""
+
+TPL_IMPL_MODE_CASE = \
+"""
+ case {type}::{enum}:
+ out << "{enum}";
+ break;"""
+
+TPL_DECL_MODE_HANDLER = \
+"""
+{type}
+stringTo{type}(const std::string& option, const std::string& optarg);"""
+
+TPL_IMPL_MODE_HANDLER = TPL_DECL_MODE_HANDLER[:-1] + \
+"""
+{{
+ {cases}
+ else if (optarg == "help")
+ {{
+ puts({help});
+ exit(1);
+ }}
+ else
+ {{
+ throw OptionException(std::string("unknown option for --{long}: `") +
+ optarg + "'. Try --{long}=help.");
+ }}
+}}
+"""
+
+TPL_MODE_HANDLER_CASE = \
+"""if (optarg == "{name}")
+ {{
+ return {type}::{enum};
+ }}"""
class Module(object):
self.links = []
self.read_only = False
self.alternate = True # add --no- alternative long option for bool
- self.lineno = None
self.filename = None
for (attr, val) in d.items():
assert attr in self.__dict__
def __init__(self, d):
self.__dict__ = dict((k, None) for k in ALIAS_ATTR_ALL)
self.links = []
- self.lineno = None
self.filename = None
self.alternate_for = None # replaces a --no- alternative for an option
for (attr, val) in d.items():
sys.exit('[error] {}'.format(msg))
-def perr(filename, lineno, msg):
- die('parse error in {}:{}: {}'.format(filename, lineno + 1, msg))
+def perr(filename, msg, option_or_alias = None):
+ msg_suffix = ''
+ if option_or_alias:
+ if isinstance(option_or_alias, Option):
+ msg_suffix = 'option '
+ if option_or_alias.name:
+ msg_suffix = "{} '{}' ".format(msg_suffix, option_or_alias.name)
+ else:
+ msg_suffix = "{} '{}' ".format(msg_suffix, option_or_alias.long)
+ else:
+ assert isinstance(option_or_alias, Alias)
+ msg_suffix = "alias '{}' ".format(option_or_alias.long)
+ die('parse error in {}: {}{}'.format(filename, msg, msg_suffix))
def write_file(directory, name, content):
lines.extend([' ' * width_opt + l for l in text[1:]])
return ['"{}\\n"'.format(x) for x in lines]
+def help_mode_format(option):
+ """
+ Format help message for mode options.
+ """
+ assert option.help_mode
+ assert option.mode
+
+ wrapper = textwrap.TextWrapper(width=78, break_on_hyphens=False)
+ text = ['{}'.format(x) for x in wrapper.wrap(option.help_mode)]
+ text.append('Available modes for --{} are:'.format(option.long.split('=')[0]))
+
+ for value, attrib in option.mode.items():
+ assert len(attrib) == 1
+ attrib = attrib[0]
+ if value == option.default and attrib['name'] != "default":
+ text.append('+ {} (default)'.format(attrib['name']))
+ else:
+ text.append('+ {}'.format(attrib['name']))
+ if 'help' in attrib:
+ text.extend(' {}'.format(x) for x in wrapper.wrap(attrib['help']))
+
+ return '\n '.join('"{}\\n"'.format(x) for x in text)
+
def codegen_module(module, dst_dir, tpl_module_h, tpl_module_cpp):
"""
decls = []
specs = []
inls = []
+ mode_decl = []
+ mode_impl = []
# *_options_.cpp
accs = []
# Global definitions
defs.append('struct {name}__option_t {name};'.format(name=option.name))
+ if option.mode:
+ values = option.mode.keys()
+ mode_decl.append(
+ TPL_DECL_MODE_ENUM.format(
+ type=option.type,
+ values=',\n '.join(values)))
+ mode_decl.append(TPL_DECL_MODE_FUNC.format(type=option.type))
+ cases = [TPL_IMPL_MODE_CASE.format(
+ type=option.type, enum=x) for x in values]
+ mode_impl.append(
+ TPL_IMPL_MODE_FUNC.format(
+ type=option.type,
+ cases=''.join(cases)))
+
+ # Generate str-to-enum handler
+ cases = []
+ for value, attrib in option.mode.items():
+ assert len(attrib) == 1
+ cases.append(
+ TPL_MODE_HANDLER_CASE.format(
+ name=attrib[0]['name'],
+ type=option.type,
+ enum=value))
+ assert option.long
+ assert cases
+ mode_decl.append(TPL_DECL_MODE_HANDLER.format(type=option.type))
+ mode_impl.append(
+ TPL_IMPL_MODE_HANDLER.format(
+ type=option.type,
+ cases='\n else '.join(cases),
+ help=help_mode_format(option),
+ long=option.long.split('=')[0]))
filename = os.path.splitext(os.path.split(module.header)[1])[0]
write_file(dst_dir, '{}.h'.format(filename), tpl_module_h.format(
holder_spec=' \\\n'.join(holder_specs),
decls='\n'.join(decls),
specs='\n'.join(specs),
- inls='\n'.join(inls)
- ))
+ inls='\n'.join(inls),
+ modes=''.join(mode_decl)))
write_file(dst_dir, '{}.cpp'.format(filename), tpl_module_cpp.format(
filename=filename,
accs='\n'.join(accs),
- defs='\n'.join(defs)
- ))
+ defs='\n'.join(defs),
+ modes=''.join(mode_impl)))
def docgen(category, name, smt_name, short_name, long_name, ctype, default,
'.TP\n.I "{} OPTIONS"'.format(module.name.upper()))
man_others_int.append(man_others_smt[-1])
-
for option in \
sorted(module.options, key=lambda x: x.long if x.long else x.name):
assert option.type != 'void' or option.name is None
else:
handler = \
'handler->{}(option, optionarg)'.format(option.handler)
+ elif option.mode:
+ handler = 'stringTo{}(option, optionarg)'.format(option.type)
elif option.type != 'bool':
handler = \
'handleOption<{}>(option, optionarg)'.format(option.type)
# Default option values
default = option.default if option.default else ''
+ # Prepend enum name
+ if option.mode and option.type not in default:
+ default = '{}::{}'.format(option.type, default)
defaults.append('{}({})'.format(option.name, default))
defaults.append('{}__setByUser__(false)'.format(option.name))
return s[:-len(suffix)] if s.endswith(suffix) else s
-def check_attribs(filename, lineno, req_attribs, valid_attribs, attribs, ctype):
+def check_attribs(filename, req_attribs, valid_attribs, attribs, ctype):
"""
Check if for a given module/option/alias the defined attributes are valid and
if all required attributes are defined.
msg_for = ""
if 'name' in attribs:
msg_for = " for '{}'".format(attribs['name'])
+ elif 'long' in attribs:
+ msg_for = " for '{}'".format(attribs['long'])
for k in req_attribs:
if k not in attribs:
- perr(filename, lineno,
+ perr(filename,
"required {} attribute '{}' not specified{}".format(
ctype, k, msg_for))
for k in attribs:
if k not in valid_attribs:
- perr(filename, lineno,
+ perr(filename,
"invalid {} attribute '{}' specified{}".format(
ctype, k, msg_for))
-def check_unique(filename, lineno, value, cache):
+def check_unique(filename, value, cache):
"""
Check if given name is unique in cache.
"""
if value in cache:
- perr(filename, lineno,
- "'{}' already defined in '{}' at line {}".format(
- value, cache[value][0], cache[value][1]))
- cache[value] = (filename, lineno + 1)
+ perr(filename,
+ "'{}' already defined in '{}'".format(value, cache[value]))
+ else:
+ cache[value] = filename
-def check_long(filename, lineno, long_name, ctype=None):
+def check_long(filename, option_or_alias, long_name, ctype=None):
"""
Check if given long option name is valid.
"""
if long_name is None:
return
if long_name.startswith('--'):
- perr(filename, lineno, 'remove -- prefix from long option')
+ perr(filename, 'remove -- prefix from long', option_or_alias)
r = r'^[0-9a-zA-Z\-=]+$'
if not re.match(r, long_name):
- perr(filename, lineno,
- "long option '{}' does not match regex criteria '{}'".format(
- long_name, r))
+ perr(filename,
+ "long '{}' does not match regex criteria '{}'".format(
+ long_name, r), option_or_alias)
name = long_get_option(long_name)
- check_unique(filename, lineno, name, g_long_cache)
+ check_unique(filename, name, g_long_cache)
if ctype == 'bool':
- check_unique(filename, lineno, 'no-{}'.format(name), g_long_cache)
-
+ check_unique(filename, 'no-{}'.format(name), g_long_cache)
-def check_links(filename, lineno, links):
+def check_links(filename, option_or_alias):
"""
Check if long options defined in links are valid and correctly used.
"""
global g_long_cache, g_long_arguments
- for link in links:
+ for link in option_or_alias.links:
long_name = lstrip('no-', lstrip('--', long_get_option(link)))
if long_name not in g_long_cache:
- perr(filename, lineno,
- "invalid long option '{}' in links list".format(link))
+ perr(filename,
+ "invalid long option '{}' in links list".format(link),
+ option_or_alias)
# check if long option requires an argument
if long_name in g_long_arguments and '=' not in link:
- perr(filename, lineno,
- "linked option '{}' requires an argument".format(link))
-
-
-def check_alias_attrib(filename, lineno, attrib, value):
- """
- Check alias attribute values. All attribute checks that can be done while
- parsing should be done here.
- """
- if attrib not in ALIAS_ATTR_ALL:
- perr(filename, lineno, "invalid alias attribute '{}'".format(attrib))
- if attrib == 'category':
- if value not in CATEGORY_VALUES:
- perr(filename, lineno, "invalid category value '{}'".format(value))
- elif attrib == 'long':
- pass # Will be checked after parsing is done
- elif attrib == 'links':
- assert isinstance(value, list)
- if not value:
- perr(filename, lineno, 'links list must not be empty')
-
-
-def check_option_attrib(filename, lineno, attrib, value):
- """
- Check option attribute values. All attribute checks that can be done while
- parsing should be done here.
- """
- global g_smt_cache, g_name_cache, g_short_cache
-
- if attrib not in OPTION_ATTR_ALL:
- perr(filename, lineno, "invalid option attribute '{}'".format(attrib))
-
- if attrib == 'category':
- if value not in CATEGORY_VALUES:
- perr(filename, lineno, "invalid category value '{}'".format(value))
- elif attrib == 'type':
- if not value:
- perr(filename, lineno, 'type must not be empty')
- elif attrib == 'long':
- pass # Will be checked after parsing is done
- elif attrib == 'name' and value:
- r = r'^[a-zA-Z]+[0-9a-zA-Z_]*$'
- if not re.match(r, value):
- perr(filename, lineno,
- "name '{}' does not match regex criteria '{}'".format(
- value, r))
- check_unique(filename, lineno, value, g_name_cache)
- elif attrib == 'smt_name' and value:
- r = r'^[a-zA-Z]+[0-9a-zA-Z\-_]*$'
- if not re.match(r, value):
- perr(filename, lineno,
- "smt_name '{}' does not match regex criteria '{}'".format(
- value, r))
- check_unique(filename, lineno, value, g_smt_cache)
- elif attrib == 'short' and value:
- if value[0].startswith('-'):
- perr(filename, lineno, 'remove - prefix from short option')
- if len(value) != 1:
- perr(filename, lineno, 'short option must be of length 1')
- if not value.isalpha() and not value.isdigit():
- perr(filename, lineno, 'short option must be a character or a digit')
- check_unique(filename, lineno, value, g_short_cache)
- elif attrib == 'default':
- pass
- elif attrib == 'includes' and value:
- if not isinstance(value, list):
- perr(filename, lineno, 'expected list for includes attribute')
- elif attrib == 'handler':
- pass
- elif attrib == 'predicates' and value:
- if not isinstance(value, list):
- perr(filename, lineno, 'expected list for predicates attribute')
- elif attrib == 'notifies' and value:
- if not isinstance(value, list):
- perr(filename, lineno, 'expected list for notifies attribute')
- elif attrib == 'links' and value:
- if not isinstance(value, list):
- perr(filename, lineno, 'expected list for links attribute')
- elif attrib in ['read_only', 'alternate'] and value is not None:
- if not isinstance(value, bool):
- perr(filename, lineno,
- "expected true/false instead of '{}' for {}".format(
- value, attrib))
-
-
-def check_module_attrib(filename, lineno, attrib, value):
- """
- Check module attribute values. All attribute checks that can be done while
- parsing should be done here.
- """
- global g_module_id_cache
- if attrib not in MODULE_ATTR_ALL:
- perr(filename, lineno, "invalid module attribute '{}'".format(attrib))
- if attrib == 'id':
- if not value:
- perr(filename, lineno, 'module id must not be empty')
- if value in g_module_id_cache:
- perr(filename, lineno,
- "module id '{}' already defined in '{}' at line {}".format(
- value,
- g_module_id_cache[value][0],
- g_module_id_cache[value][1]))
- g_module_id_cache[value] = (filename, lineno)
- r = r'^[A-Z]+[A-Z_]*$'
- if not re.match(r, value):
- perr(filename, lineno,
- "module id '{}' does not match regex criteria '{}'".format(
- value, r))
- elif attrib == 'name':
- if not value:
- perr(filename, lineno, 'module name must not be empty')
- elif attrib == 'header':
- if not value:
- perr(filename, lineno, 'module header must not be empty')
- header_name = \
- 'options/{}.h'.format(rstrip('.toml', os.path.basename(filename)))
- if header_name != value:
- perr(filename, lineno,
- "expected module header '{}' instead of '{}'".format(
- header_name, value))
-
-
-def parse_value(filename, lineno, attrib, val):
- """
- Parse attribute values.
- We only allow three types of values:
- - bool (val either true/false or "true"/"false")
- - string (val starting with ")
- - lists (val starting with [)
- """
- if val[0] == '"':
- if val[-1] != '"':
- perr(filename, lineno, 'missing closing " for string')
- val = val.lstrip('"').rstrip('"').replace('\\"', '"')
-
- # for read_only/alternate we allow both true/false and "true"/"false"
- if attrib in ['read_only', 'alternate']:
- if val == 'true':
- return True
- elif val == 'false':
- return False
- return val if val else None
- elif val[0] == '[':
- try:
- val_list = ast.literal_eval(val)
- except SyntaxError as e:
- perr(filename, lineno, 'parsing list: {}'.format(e.msg))
- return val_list
- elif val == 'true':
- return True
- elif val == 'false':
- return False
- else:
- perr(filename, lineno, "invalid value '{}'".format(val))
- return None
+ perr(filename,
+ "linked option '{}' requires an argument".format(link),
+ option_or_alias)
-def parse_module(filename, file):
+def parse_module(filename, module):
"""
Parse options module file.
toml format, we chose to implement our own parser to get better error
messages.
"""
- module = dict()
- options = []
- aliases = []
- lines = [[x.strip() for x in line.split('=', 1)] for line in file]
- option = None
- alias = None
- option_lines = []
- alias_lines = []
- for i in range(len(lines)):
- assert option is None or alias is None
- line = lines[i]
- # Skip comments
- if line[0].startswith('#'):
- continue
- # Check if a new option/alias starts.
- if len(line) == 1:
- # Create a new option/alias object, save previously created
- if line[0] in ['[[option]]', '[[alias]]']:
- if option:
- options.append(option)
- option = None
- if alias:
- aliases.append(alias)
- alias = None
- # Create new option dict and save line number where option
- # was defined.
- if line[0] == '[[option]]':
- assert alias is None
- option = dict()
- option_lines.append(i)
- else:
- # Create new alias dict and save line number where alias
- # was defined.
- assert line[0] == '[[alias]]'
- assert option is None
- alias = dict()
- # Save line number where alias was defined
- alias_lines.append(i)
- elif line[0] != '':
- perr(filename, i, "invalid attribute '{}'".format(line[0]))
- # Parse module/option/alias attributes.
- elif len(line) == 2:
- attrib = line[0]
- value = parse_value(filename, i, attrib, line[1])
- # All attributes we parse are part of the current option.
- if option is not None:
- check_option_attrib(filename, i, attrib, value)
- if attrib in option:
- perr(filename, i,
- "duplicate option attribute '{}'".format(attrib))
- assert option is not None
- option[attrib] = value
- # All attributes we parse are part of the current alias.
- elif alias is not None:
- check_alias_attrib(filename, i, attrib, value)
- if attrib in alias:
- perr(filename, i,
- "duplicate alias attribute '{}'".format(attrib))
- assert alias is not None
- alias[attrib] = value
- # All other attributes are part of the module.
- else:
- if attrib in module:
- perr(filename, i,
- "duplicate module attribute '{}'".format(attrib))
- check_module_attrib(filename, i, attrib, value)
- module[attrib] = value
- else:
- perr(filename, i, "invalid attribute '{}'".format(line[0]))
-
- # Save previously parsed option/alias
- if option:
- options.append(option)
- if alias:
- aliases.append(alias)
-
# Check if parsed module attributes are valid and if all required
# attributes are defined.
- check_attribs(filename, 1,
+ check_attribs(filename,
MODULE_ATTR_REQ, MODULE_ATTR_ALL, module, 'module')
res = Module(module)
- # Check parsed option/alias attributes and create option/alias objects and
- # associate file name and line number with options/aliases (required for
- # better error reporting).
- assert len(option_lines) == len(options)
- assert len(alias_lines) == len(aliases)
- for i in range(len(options)):
- attribs = options[i]
- lineno = option_lines[i]
- check_attribs(filename, lineno,
- OPTION_ATTR_REQ, OPTION_ATTR_ALL, attribs, 'option')
- option = Option(attribs)
- if option.short and not option.long:
- perr(filename, lineno,
- "short option '{}' specified but no long option".format(
- option.short))
- if option.type == 'bool' and option.handler:
- perr(filename, lineno,
- 'specifying handlers for options of type bool is not allowed')
- if option.category != 'undocumented' and not option.help:
- perr(filename, lineno,
- 'help text is required for {} options'.format(option.category))
- option.lineno = lineno
- option.filename = filename
- res.options.append(option)
-
- for i in range(len(aliases)):
- attribs = aliases[i]
- lineno = alias_lines[i]
- check_attribs(filename, lineno,
- ALIAS_ATTR_REQ, ALIAS_ATTR_ALL, attribs, 'alias')
- alias = Alias(attribs)
- alias.lineno = lineno
- alias.filename = filename
- res.aliases.append(alias)
+ if 'option' in module:
+ for attribs in module['option']:
+ lineno = 0
+ check_attribs(filename,
+ OPTION_ATTR_REQ, OPTION_ATTR_ALL, attribs, 'option')
+ option = Option(attribs)
+ if option.mode and not option.help_mode:
+ perr(filename, 'defines modes but no help_mode', option)
+ if option.mode and option.handler:
+ perr(filename, 'defines modes and a handler', option)
+ if option.mode and option.default and \
+ option.default not in option.mode.keys():
+ perr(filename,
+ "invalid default value '{}'".format(option.default),
+ option)
+ if option.short and not option.long:
+ perr(filename,
+ "short option '{}' specified but no long option".format(
+ option.short),
+ option)
+ if option.type == 'bool' and option.handler:
+ perr(filename,
+ 'defining handlers for bool options is not allowed',
+ option)
+ if option.category != 'undocumented' and not option.help:
+ perr(filename,
+ 'help text required for {} options'.format(option.category),
+ option)
+ option.filename = filename
+ res.options.append(option)
+
+ if 'alias' in module:
+ for attribs in module['alias']:
+ lineno = 0
+ check_attribs(filename,
+ ALIAS_ATTR_REQ, ALIAS_ATTR_ALL, attribs, 'alias')
+ alias = Alias(attribs)
+ alias.filename = filename
+ res.aliases.append(alias)
return res
# Parse files, check attributes and create module/option objects
modules = []
for filename in filenames:
- with open(filename, 'r') as file:
- module = parse_module(filename, file)
- # Check if long options are valid and unique. First populate
- # g_long_cache with option.long and --no- alternatives if
- # applicable.
- for option in module.options:
- check_long(option.filename, option.lineno, option.long,
- option.type)
- if option.long:
- g_long_to_opt[long_get_option(option.long)] = option
- # Add long option that requires an argument
- if option.type not in ['bool', 'void']:
- g_long_arguments.add(long_get_option(option.long))
- modules.append(module)
+ module = parse_module(filename, toml.load(filename))
+
+ # Check if long options are valid and unique. First populate
+ # g_long_cache with option.long and --no- alternatives if
+ # applicable.
+ for option in module.options:
+ check_long(filename, option, option.long, option.type)
+ if option.long:
+ g_long_to_opt[long_get_option(option.long)] = option
+ # Add long option that requires an argument
+ if option.type not in ['bool', 'void']:
+ g_long_arguments.add(long_get_option(option.long))
+ modules.append(module)
# Check if alias.long is unique and check if alias.long defines an alias
# for an alternate (--no-<long>) option for existing option <long>.
m[0].alternate = False
alias.alternate_for = m[0]
del g_long_cache[alias.long]
- check_long(alias.filename, alias.lineno, alias.long)
+ check_long(alias.filename, alias, alias.long)
# Add long option that requires an argument
if '=' in alias.long:
g_long_arguments.add(long_get_option(alias.long))
# long options are available).
for module in modules:
for option in module.options:
- check_links(option.filename, option.lineno, option.links)
+ check_links(option.filename, option)
for alias in module.aliases:
- check_links(alias.filename, alias.lineno, alias.links)
+ check_links(alias.filename, alias)
# Create *_options.{h,cpp} in destination directory
for module in modules:
**/
#include "options/options_holder.h"
+#include "base/check.h"
namespace CVC4 {
${defs}$
+${modes}$
} // namespace options
} // namespace CVC4
namespace options {
-${decls}$
+${modes}$
+${decls}$
} // namespace options
${inls}$
-
} // namespace options
} // namespace CVC4
// Get accessor functions.
InputLanguage getInputLanguage() const;
- InstFormatMode getInstFormatMode() const;
+ options::InstFormatMode getInstFormatMode() const;
OutputLanguage getOutputLanguage() const;
bool getUfHo() const;
bool getCheckProofs() const;
#include "options/options.h"
%}
-%ignore CVC4::operator<<(std::ostream&, SimplificationMode);
-%ignore CVC4::operator<<(std::ostream&, ArithPivotRule);
-
%apply char** STRING_ARRAY { char* argv[] }
%include "options/options.h"
%clear char* argv[];
#include "base/modal_exception.h"
#include "base/output.h"
#include "lib/strtok_r.h"
-#include "options/arith_heuristic_pivot_rule.h"
-#include "options/arith_propagation_mode.h"
-#include "options/arith_unate_lemma_mode.h"
#include "options/base_options.h"
-#include "options/bv_bitblast_mode.h"
#include "options/bv_options.h"
-#include "options/datatypes_modes.h"
-#include "options/decision_mode.h"
#include "options/decision_options.h"
#include "options/didyoumean.h"
#include "options/language.h"
#include "options/option_exception.h"
-#include "options/printer_modes.h"
#include "options/smt_options.h"
#include "options/theory_options.h"
-#include "options/theoryof_mode.h"
-#include "options/ufss_mode.h"
namespace CVC4 {
namespace options {
// helper functions
namespace {
-void throwLazyBBUnsupported(theory::bv::SatSolverMode m)
+void throwLazyBBUnsupported(options::SatSolverMode m)
{
std::string sat_solver;
- if (m == theory::bv::SAT_SOLVER_CADICAL)
+ if (m == options::SatSolverMode::CADICAL)
{
sat_solver = "CaDiCaL";
}
else
{
- Assert(m == theory::bv::SAT_SOLVER_CRYPTOMINISAT);
+ Assert(m == options::SatSolverMode::CRYPTOMINISAT);
sat_solver = "CryptoMiniSat";
}
std::string indent(25, ' ');
d_options->d_setPrintSuccessListeners.notify();
}
-// theory/arith/options_handlers.h
-const std::string OptionsHandler::s_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\
-";
-
-const std::string OptionsHandler::s_arithPropagationModeHelp = "\
-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\
-";
-
-const std::string OptionsHandler::s_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\
-";
-
-ArithUnateLemmaMode OptionsHandler::stringToArithUnateLemmaMode(
- std::string option, std::string optarg)
-{
- 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(s_arithUnateLemmasHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --unate-lemmas: `") +
- optarg + "'. Try --unate-lemmas help.");
- }
-}
-
-ArithPropagationMode OptionsHandler::stringToArithPropagationMode(
- std::string option, std::string optarg)
-{
- 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(s_arithPropagationModeHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --arith-prop: `") +
- optarg + "'. Try --arith-prop help.");
- }
-}
-
-ErrorSelectionRule OptionsHandler::stringToErrorSelectionRule(
- std::string option, std::string optarg)
-{
- 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(s_errorSelectionRulesHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --heuristic-pivot-rule: `") +
- optarg + "'. Try --heuristic-pivot-rule help.");
- }
-}
// theory/quantifiers/options_handlers.h
-const std::string OptionsHandler::s_instWhenHelp = "\
-Instantiation modes currently supported by the --inst-when option:\n\
-\n\
-full-last-call (default)\n\
-+ Alternate running instantiation rounds at full effort and last\n\
- call. In other words, interleave instantiation and theory combination.\n\
-\n\
-full\n\
-+ Run instantiation round at full effort, before theory combination.\n\
-\n\
-full-delay \n\
-+ Run instantiation round at full effort, before theory combination, after\n\
- all other theories have finished.\n\
-\n\
-full-delay-last-call \n\
-+ Alternate running instantiation rounds at full effort after all other\n\
- theories have finished, and last call. \n\
-\n\
-last-call\n\
-+ Run instantiation at last call effort, after theory combination and\n\
- and theories report sat.\n\
-\n\
-";
-
-const std::string OptionsHandler::s_literalMatchHelp = "\
-Literal match modes currently supported by the --literal-match option:\n\
-\n\
-none \n\
-+ Do not use literal matching.\n\
-\n\
-use (default)\n\
-+ Consider phase requirements of triggers conservatively. For example, the\n\
- trigger P( x ) in forall( x ). ( P( x ) V ~Q( x ) ) will not be matched with\n\
- terms in the equivalence class of true, and likewise Q( x ) will not be matched\n\
- terms in the equivalence class of false. Extends to equality.\n\
-\n\
-agg-predicate \n\
-+ Consider phase requirements aggressively for predicates. In the above example,\n\
- only match P( x ) with terms that are in the equivalence class of false.\n\
-\n\
-agg \n\
-+ Consider the phase requirements aggressively for all triggers.\n\
-\n\
-";
-
-const std::string OptionsHandler::s_mbqiModeHelp =
- "\
-Model-based quantifier instantiation modes currently supported by the --mbqi option:\n\
-\n\
-default \n\
-+ Use algorithm from Section 5.4.2 of thesis Finite Model Finding in Satisfiability \n\
- Modulo Theories.\n\
-\n\
-none \n\
-+ Disable model-based quantifier instantiation.\n\
-\n\
-trust \n\
-+ Do not instantiate quantified formulas (incomplete technique).\n\
-\n\
-";
-
-const std::string OptionsHandler::s_qcfWhenModeHelp = "\
-Quantifier conflict find modes currently supported by the --quant-cf-when option:\n\
-\n\
-default \n\
-+ Default, apply conflict finding at full effort.\n\
-\n\
-last-call \n\
-+ Apply conflict finding at last call, after theory combination and \n\
- and all theories report sat. \n\
-\n\
-std \n\
-+ Apply conflict finding at standard effort.\n\
-\n\
-std-h \n\
-+ Apply conflict finding at standard effort when heuristic says to. \n\
-\n\
-";
-
-const std::string OptionsHandler::s_qcfModeHelp = "\
-Quantifier conflict find modes currently supported by the --quant-cf option:\n\
-\n\
-prop-eq \n\
-+ Default, apply QCF algorithm to propagate equalities as well as conflicts. \n\
-\n\
-conflict \n\
-+ Apply QCF algorithm to find conflicts only.\n\
-\n\
-";
-
-const std::string OptionsHandler::s_userPatModeHelp = "\
-User pattern modes currently supported by the --user-pat option:\n\
-\n\
-trust \n\
-+ When provided, use only user-provided patterns for a quantified formula.\n\
-\n\
-use \n\
-+ Use both user-provided and auto-generated patterns when patterns\n\
- are provided for a quantified formula.\n\
-\n\
-resort \n\
-+ Use user-provided patterns only after auto-generated patterns saturate.\n\
-\n\
-ignore \n\
-+ Ignore user-provided patterns. \n\
-\n\
-interleave \n\
-+ Alternate between use/resort. \n\
-\n\
-";
-
-const std::string OptionsHandler::s_triggerSelModeHelp = "\
-Trigger selection modes currently supported by the --trigger-sel option:\n\
-\n\
-min | default \n\
-+ Consider only minimal subterms that meet criteria for triggers.\n\
-\n\
-max \n\
-+ Consider only maximal subterms that meet criteria for triggers. \n\
-\n\
-all \n\
-+ Consider all subterms that meet criteria for triggers. \n\
-\n\
-min-s-max \n\
-+ Consider only minimal subterms that meet criteria for single triggers, maximal otherwise. \n\
-\n\
-min-s-all \n\
-+ Consider only minimal subterms that meet criteria for single triggers, all otherwise. \n\
-\n\
-";
-const std::string OptionsHandler::s_triggerActiveSelModeHelp = "\
-Trigger active selection modes currently supported by the \
---trigger-active-sel option:\n\
-\n\
-all \n\
-+ Make all triggers active. \n\
-\n\
-min \n\
-+ Activate triggers with minimal ground terms.\n\
-\n\
-max \n\
-+ Activate triggers with maximal ground terms. \n\
-\n\
-";
-const std::string OptionsHandler::s_prenexQuantModeHelp = "\
-Prenex quantifiers modes currently supported by the --prenex-quant option:\n\
-\n\
-none \n\
-+ Do no prenex nested quantifiers. \n\
-\n\
-default | simple \n\
-+ Default, do simple prenexing of same sign quantifiers.\n\
-\n\
-dnorm \n\
-+ Prenex to disjunctive prenex normal form.\n\
-\n\
-norm \n\
-+ Prenex to prenex normal form.\n\
-\n\
-";
-
-const std::string OptionsHandler::s_cegqiFairModeHelp = "\
-Modes for enforcing fairness for counterexample guided quantifier instantion, supported by --sygus-fair:\n\
-\n\
-uf-dt-size \n\
-+ Enforce fairness using an uninterpreted function for datatypes size.\n\
-\n\
-direct \n\
-+ Enforce fairness using direct conflict lemmas.\n\
-\n\
-default | dt-size \n\
-+ Default, enforce fairness using size operator.\n\
-\n\
-dt-height-bound \n\
-+ Enforce fairness by height bound predicate.\n\
-\n\
-none \n\
-+ Do not enforce fairness. \n\
-\n\
-";
-
-const std::string OptionsHandler::s_termDbModeHelp = "\
-Modes for terms included in the quantifiers term database, supported by\
---term-db-mode:\n\
-\n\
-all \n\
-+ Quantifiers module considers all ground terms.\n\
-\n\
-relevant \n\
-+ Quantifiers module considers only ground terms connected to current assertions. \n\
-\n\
-";
-
-const std::string OptionsHandler::s_iteLiftQuantHelp = "\
-Modes for term database, supported by --ite-lift-quant:\n\
-\n\
-none \n\
-+ Do not lift if-then-else in quantified formulas.\n\
-\n\
-simple \n\
-+ Lift if-then-else in quantified formulas if results in smaller term size.\n\
-\n\
-all \n\
-+ Lift if-then-else in quantified formulas. \n\
-\n\
-";
-
-const std::string OptionsHandler::s_cbqiBvIneqModeHelp =
- "\
-Modes for handling bit-vector inequalities in counterexample-guided\
-instantiation, supported by --cbqi-bv-ineq:\n\
-\n\
-eq-slack (default) \n\
-+ Solve for the inequality using the slack value in the model, e.g.,\
- t > s becomes t = s + ( t-s )^M.\n\
-\n\
-eq-boundary \n\
-+ Solve for the boundary point of the inequality, e.g.,\
- t > s becomes t = s+1.\n\
-\n\
-keep \n\
-+ Solve for the inequality directly using side conditions for invertibility.\n\
-\n\
-";
-
-const std::string OptionsHandler::s_cegqiSingleInvHelp = "\
-Modes for single invocation techniques, supported by --cegqi-si:\n\
-\n\
-none \n\
-+ Do not use single invocation techniques.\n\
-\n\
-use (default) \n\
-+ Use single invocation techniques only if grammar is not restrictive.\n\
-\n\
-all-abort \n\
-+ Always use single invocation techniques, abort if solution reconstruction will likely fail,\
- for instance, when the grammar does not have ITE and solution requires it.\n\
-\n\
-all \n\
-+ Always use single invocation techniques. \n\
-\n\
-";
-
-const std::string OptionsHandler::s_cegqiSingleInvRconsHelp =
- "\
-Modes for reconstruction solutions while using single invocation techniques,\
-supported by --cegqi-si-rcons:\n\
-\n\
-none \n\
-+ Do not try to reconstruct solutions in the original (user-provided) grammar\
- when using single invocation techniques. In this mode, solutions produced by\
- CVC4 may violate grammar restrictions.\n\
-\n\
-try \n\
-+ Try to reconstruct solutions in the original grammar when using single\
- invocation techniques in an incomplete (fail-fast) manner.\n\
-\n\
-all-limit \n\
-+ Try to reconstruct solutions in the original grammar, but termintate if a\
- maximum number of rounds for reconstruction is exceeded.\n\
-\n\
-all \n\
-+ Try to reconstruct solutions in the original grammar. In this mode,\
- we do not terminate until a solution is successfully reconstructed. \n\
-\n\
-";
-
-const std::string OptionsHandler::s_cegisSampleHelp =
- "\
-Modes for sampling with counterexample-guided inductive synthesis (CEGIS),\
-supported by --cegis-sample:\n\
-\n\
-none (default) \n\
-+ Do not use sampling with CEGIS.\n\
-\n\
-use \n\
-+ Use sampling to accelerate CEGIS. This will rule out solutions for a\
- conjecture when they are not satisfied by a sample point.\n\
-\n\
-trust \n\
-+ Trust that when a solution for a conjecture is always true under sampling,\
- then it is indeed a solution. Note this option may print out spurious\
- solutions for synthesis conjectures.\n\
-\n\
-";
-
-const std::string OptionsHandler::s_sygusQueryDumpFileHelp =
- "\
-Query file options supported by --sygus-query-gen-dump-files:\n\
-\n\
-none (default) \n\
-+ Do not dump query files when using --sygus-query-gen.\n\
-\n\
-all \n\
-+ Dump all query files.\n\
-\n\
-unsolved \n\
-+ Dump query files that the subsolver did not solve.\n\
-\n\
-";
-
-const std::string OptionsHandler::s_sygusFilterSolHelp =
- "\
-Modes for filtering sygus solutions supported by --sygus-filter-sol:\n\
-\n\
-none (default) \n\
-+ Do not filter sygus solutions.\n\
-\n\
-strong \n\
-+ Filter solutions that are logically stronger than others.\n\
-\n\
-weak \n\
-+ Filter solutions that are logically weaker than others.\n\
-\n\
-";
-
-const std::string OptionsHandler::s_sygusInvTemplHelp = "\
-Template modes for sygus invariant synthesis, supported by --sygus-inv-templ:\n\
-\n\
-none \n\
-+ Synthesize invariant directly.\n\
-\n\
-pre \n\
-+ Synthesize invariant based on weakening of precondition .\n\
-\n\
-post \n\
-+ Synthesize invariant based on strengthening of postcondition. \n\
-\n\
-";
-
-const std::string OptionsHandler::s_sygusActiveGenHelp =
- "\
-Modes for actively-generated sygus enumerators, supported by --sygus-active-gen:\n\
-\n\
-none \n\
-+ Do not use actively-generated sygus enumerators.\n\
-\n\
-basic \n\
-+ Use basic type enumerator for actively-generated sygus enumerators.\n\
-\n\
-enum \n\
-+ Use optimized enumerator for actively-generated sygus enumerators.\n\
-\n\
-var-agnostic \n\
-+ Use sygus solver to enumerate terms that are agnostic to variables. \n\
-\n\
-auto (default) \n\
-+ Internally decide the best policy for each enumerator. \n\
-\n\
-";
-
-const std::string OptionsHandler::s_sygusUnifPiHelp =
- "\
-Modes for piecewise-independent unification supported by --sygus-unif-pi:\n\
-\n\
-none \n\
-+ Do not use piecewise-independent unification.\n\
-\n\
-complete \n\
-+ Use complete approach for piecewise-independent unification (see Section 3\n\
-of Barbosa et al FMCAD 2019).\n\
-\n\
-cond-enum \n\
-+ Use unconstrained condition enumeration for piecewise-independent\n\
-unification (see Section 4 of Barbosa et al FMCAD 2019).\n\
-\n\
-cond-enum-igain \n\
-+ Same as cond-enum, but additionally uses an information gain heuristic\n\
-when doing decision tree learning.\n\
-\n\
-";
-
-const std::string OptionsHandler::s_sygusGrammarConsHelp =
- "\
-Modes for default SyGuS grammars, supported by --sygus-grammar-cons:\n\
-\n\
-simple (default) \n\
-+ Use simple grammar construction (no symbolic terms or constants).\n\
-\n\
-any-const \n\
-+ Use symoblic constant constructors.\n\
-\n\
-any-term \n\
-+ When applicable, use constructors corresponding to any symbolic term.\n\
-This option enables a sum-of-monomials grammar for arithmetic. For all\n\
-other types, it enables symbolic constant constructors.\n\
-\n\
-any-term-concise \n\
-+ When applicable, use constructors corresponding to any symbolic term,\n\
-favoring conciseness over generality. This option is equivalent to any-term\n\
-but enables a polynomial grammar for arithmetic when not in a combined\n\
-theory.\n\
-\n\
-";
-
-const std::string OptionsHandler::s_macrosQuantHelp = "\
-Modes for quantifiers macro expansion, supported by --macros-quant-mode:\n\
-\n\
-all \n\
-+ Infer definitions for functions, including those containing quantified formulas.\n\
-\n\
-ground (default) \n\
-+ Only infer ground definitions for functions.\n\
-\n\
-ground-uf \n\
-+ Only infer ground definitions for functions that result in triggers for all free variables.\n\
-\n\
-";
-
-const std::string OptionsHandler::s_quantDSplitHelp = "\
-Modes for quantifiers splitting, supported by --quant-dsplit-mode:\n\
-\n\
-none \n\
-+ Never split quantified formulas.\n\
-\n\
-default \n\
-+ Split quantified formulas over some finite datatypes when finite model finding is enabled.\n\
-\n\
-agg \n\
-+ Aggressively split quantified formulas.\n\
-\n\
-";
-
-const std::string OptionsHandler::s_quantRepHelp = "\
-Modes for quantifiers representative selection, supported by --quant-rep-mode:\n\
-\n\
-ee \n\
-+ Let equality engine choose representatives.\n\
-\n\
-first (default) \n\
-+ Choose terms that appear first.\n\
-\n\
-depth \n\
-+ Choose terms that are of minimal depth.\n\
-\n\
-";
-
-theory::quantifiers::InstWhenMode OptionsHandler::stringToInstWhenMode(
- std::string option, std::string optarg)
-{
- if(optarg == "pre-full") {
- return theory::quantifiers::INST_WHEN_PRE_FULL;
- } else if(optarg == "full") {
- return theory::quantifiers::INST_WHEN_FULL;
- } else if(optarg == "full-delay") {
- return theory::quantifiers::INST_WHEN_FULL_DELAY;
- } else if(optarg == "full-last-call") {
- return theory::quantifiers::INST_WHEN_FULL_LAST_CALL;
- } else if(optarg == "full-delay-last-call") {
- return theory::quantifiers::INST_WHEN_FULL_DELAY_LAST_CALL;
- } else if(optarg == "last-call") {
- return theory::quantifiers::INST_WHEN_LAST_CALL;
- } else if(optarg == "help") {
- puts(s_instWhenHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --inst-when: `") +
- optarg + "'. Try --inst-when help.");
- }
-}
-
-void OptionsHandler::checkInstWhenMode(std::string option,
- theory::quantifiers::InstWhenMode mode)
-{
- if(mode == theory::quantifiers::INST_WHEN_PRE_FULL) {
- throw OptionException(std::string("Mode pre-full for ") + option + " is not supported in this release.");
- }
-}
-
-theory::quantifiers::LiteralMatchMode OptionsHandler::stringToLiteralMatchMode(
- std::string option, std::string optarg)
-{
- if(optarg == "none") {
- return theory::quantifiers::LITERAL_MATCH_NONE;
- } else if(optarg == "use") {
- return theory::quantifiers::LITERAL_MATCH_USE;
- } else if(optarg == "agg-predicate") {
- return theory::quantifiers::LITERAL_MATCH_AGG_PREDICATE;
- } else if(optarg == "agg") {
- return theory::quantifiers::LITERAL_MATCH_AGG;
- } else if(optarg == "help") {
- puts(s_literalMatchHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --literal-matching: `") +
- optarg + "'. Try --literal-matching help.");
- }
-}
-
-void OptionsHandler::checkLiteralMatchMode(
- std::string option, theory::quantifiers::LiteralMatchMode mode)
-{
-}
-
-theory::quantifiers::MbqiMode OptionsHandler::stringToMbqiMode(
- std::string option, std::string optarg)
-{
- if (optarg == "none")
- {
- return theory::quantifiers::MBQI_NONE;
- } else if(optarg == "default" || optarg == "fmc") {
- return theory::quantifiers::MBQI_FMC;
- } else if(optarg == "trust") {
- return theory::quantifiers::MBQI_TRUST;
- } else if(optarg == "help") {
- puts(s_mbqiModeHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --mbqi: `") +
- optarg + "'. Try --mbqi help.");
- }
-}
-
-void OptionsHandler::checkMbqiMode(std::string option,
- theory::quantifiers::MbqiMode mode)
-{
-}
-
-theory::quantifiers::QcfWhenMode OptionsHandler::stringToQcfWhenMode(
- std::string option, std::string optarg)
-{
- if(optarg == "default") {
- return theory::quantifiers::QCF_WHEN_MODE_DEFAULT;
- } else if(optarg == "last-call") {
- return theory::quantifiers::QCF_WHEN_MODE_LAST_CALL;
- } else if(optarg == "std") {
- return theory::quantifiers::QCF_WHEN_MODE_STD;
- } else if(optarg == "std-h") {
- return theory::quantifiers::QCF_WHEN_MODE_STD_H;
- } else if(optarg == "help") {
- puts(s_qcfWhenModeHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --quant-cf-when: `") +
- optarg + "'. Try --quant-cf-when help.");
- }
-}
-
-theory::quantifiers::QcfMode OptionsHandler::stringToQcfMode(std::string option,
- std::string optarg)
-{
- if(optarg == "conflict") {
- return theory::quantifiers::QCF_CONFLICT_ONLY;
- } else if(optarg == "default" || optarg == "prop-eq") {
- return theory::quantifiers::QCF_PROP_EQ;
- } else if(optarg == "help") {
- puts(s_qcfModeHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --quant-cf-mode: `") +
- optarg + "'. Try --quant-cf-mode help.");
- }
-}
-
-theory::quantifiers::UserPatMode OptionsHandler::stringToUserPatMode(
- std::string option, std::string optarg)
-{
- if(optarg == "use") {
- return theory::quantifiers::USER_PAT_MODE_USE;
- } else if(optarg == "default" || optarg == "trust") {
- return theory::quantifiers::USER_PAT_MODE_TRUST;
- } else if(optarg == "resort") {
- return theory::quantifiers::USER_PAT_MODE_RESORT;
- } else if(optarg == "ignore") {
- return theory::quantifiers::USER_PAT_MODE_IGNORE;
- } else if(optarg == "interleave") {
- return theory::quantifiers::USER_PAT_MODE_INTERLEAVE;
- } else if(optarg == "help") {
- puts(s_userPatModeHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --user-pat: `") +
- optarg + "'. Try --user-pat help.");
- }
-}
-
-theory::quantifiers::TriggerSelMode OptionsHandler::stringToTriggerSelMode(
- std::string option, std::string optarg)
-{
- if(optarg == "default" || optarg == "min") {
- return theory::quantifiers::TRIGGER_SEL_MIN;
- } else if(optarg == "max") {
- return theory::quantifiers::TRIGGER_SEL_MAX;
- } else if(optarg == "min-s-max") {
- return theory::quantifiers::TRIGGER_SEL_MIN_SINGLE_MAX;
- } else if(optarg == "min-s-all") {
- return theory::quantifiers::TRIGGER_SEL_MIN_SINGLE_ALL;
- } else if(optarg == "all") {
- return theory::quantifiers::TRIGGER_SEL_ALL;
- } else if(optarg == "help") {
- puts(s_triggerSelModeHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --trigger-sel: `") +
- optarg + "'. Try --trigger-sel help.");
- }
-}
-
-theory::quantifiers::TriggerActiveSelMode
-OptionsHandler::stringToTriggerActiveSelMode(std::string option,
- std::string optarg)
-{
- if(optarg == "default" || optarg == "all") {
- return theory::quantifiers::TRIGGER_ACTIVE_SEL_ALL;
- } else if(optarg == "min") {
- return theory::quantifiers::TRIGGER_ACTIVE_SEL_MIN;
- } else if(optarg == "max") {
- return theory::quantifiers::TRIGGER_ACTIVE_SEL_MAX;
- } else if(optarg == "help") {
- puts(s_triggerActiveSelModeHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --trigger-active-sel: `") +
- optarg + "'. Try --trigger-active-sel help.");
- }
-}
-
-theory::quantifiers::PrenexQuantMode OptionsHandler::stringToPrenexQuantMode(
- std::string option, std::string optarg)
-{
- if(optarg== "default" || optarg== "simple" ) {
- return theory::quantifiers::PRENEX_QUANT_SIMPLE;
- } else if(optarg == "none") {
- return theory::quantifiers::PRENEX_QUANT_NONE;
- } else if(optarg == "dnorm") {
- return theory::quantifiers::PRENEX_QUANT_DISJ_NORMAL;
- } else if(optarg == "norm") {
- return theory::quantifiers::PRENEX_QUANT_NORMAL;
- } else if(optarg == "help") {
- puts(s_prenexQuantModeHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --prenex-quant: `") +
- optarg + "'. Try --prenex-quant help.");
- }
-}
-
-theory::SygusFairMode OptionsHandler::stringToSygusFairMode(std::string option,
- std::string optarg)
-{
- if(optarg == "direct") {
- return theory::SYGUS_FAIR_DIRECT;
- } else if(optarg == "default" || optarg == "dt-size") {
- return theory::SYGUS_FAIR_DT_SIZE;
- } else if(optarg == "dt-height-bound" ){
- return theory::SYGUS_FAIR_DT_HEIGHT_PRED;
- } else if(optarg == "dt-size-bound" ){
- return theory::SYGUS_FAIR_DT_SIZE_PRED;
- } else if(optarg == "none") {
- return theory::SYGUS_FAIR_NONE;
- } else if(optarg == "help") {
- puts(s_cegqiFairModeHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --cegqi-fair: `") +
- optarg + "'. Try --cegqi-fair help.");
- }
-}
-
-theory::quantifiers::TermDbMode OptionsHandler::stringToTermDbMode(
- std::string option, std::string optarg)
-{
- if(optarg == "all" ) {
- return theory::quantifiers::TERM_DB_ALL;
- } else if(optarg == "relevant") {
- return theory::quantifiers::TERM_DB_RELEVANT;
- } else if(optarg == "help") {
- puts(s_termDbModeHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --term-db-mode: `") +
- optarg + "'. Try --term-db-mode help.");
- }
-}
-
-theory::quantifiers::IteLiftQuantMode OptionsHandler::stringToIteLiftQuantMode(
- std::string option, std::string optarg)
-{
- if(optarg == "all" ) {
- return theory::quantifiers::ITE_LIFT_QUANT_MODE_ALL;
- } else if(optarg == "simple") {
- return theory::quantifiers::ITE_LIFT_QUANT_MODE_SIMPLE;
- } else if(optarg == "none") {
- return theory::quantifiers::ITE_LIFT_QUANT_MODE_NONE;
- } else if(optarg == "help") {
- puts(s_iteLiftQuantHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --ite-lift-quant: `") +
- optarg + "'. Try --ite-lift-quant help.");
- }
-}
-
-theory::quantifiers::CbqiBvIneqMode OptionsHandler::stringToCbqiBvIneqMode(
- std::string option, std::string optarg)
-{
- if (optarg == "eq-slack")
- {
- return theory::quantifiers::CBQI_BV_INEQ_EQ_SLACK;
- }
- else if (optarg == "eq-boundary")
- {
- return theory::quantifiers::CBQI_BV_INEQ_EQ_BOUNDARY;
- }
- else if (optarg == "keep")
- {
- return theory::quantifiers::CBQI_BV_INEQ_KEEP;
- }
- else if (optarg == "help")
- {
- puts(s_cbqiBvIneqModeHelp.c_str());
- exit(1);
- }
- else
- {
- throw OptionException(std::string("unknown option for --cbqi-bv-ineq: `")
- + optarg
- + "'. Try --cbqi-bv-ineq help.");
- }
-}
-
-theory::quantifiers::CegqiSingleInvMode
-OptionsHandler::stringToCegqiSingleInvMode(std::string option,
- std::string optarg)
-{
- if(optarg == "none" ) {
- return theory::quantifiers::CEGQI_SI_MODE_NONE;
- } else if(optarg == "use" || optarg == "default") {
- return theory::quantifiers::CEGQI_SI_MODE_USE;
- } else if(optarg == "all") {
- return theory::quantifiers::CEGQI_SI_MODE_ALL;
- } else if(optarg == "help") {
- puts(s_cegqiSingleInvHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --cegqi-si: `") +
- optarg + "'. Try --cegqi-si help.");
- }
-}
-
-theory::quantifiers::CegqiSingleInvRconsMode
-OptionsHandler::stringToCegqiSingleInvRconsMode(std::string option,
- std::string optarg)
-{
- if (optarg == "none")
- {
- return theory::quantifiers::CEGQI_SI_RCONS_MODE_NONE;
- }
- else if (optarg == "try")
- {
- return theory::quantifiers::CEGQI_SI_RCONS_MODE_TRY;
- }
- else if (optarg == "all")
- {
- return theory::quantifiers::CEGQI_SI_RCONS_MODE_ALL;
- }
- else if (optarg == "all-limit")
- {
- return theory::quantifiers::CEGQI_SI_RCONS_MODE_ALL_LIMIT;
- }
- else if (optarg == "help")
- {
- puts(s_cegqiSingleInvRconsHelp.c_str());
- exit(1);
- }
- else
- {
- throw OptionException(std::string("unknown option for --cegqi-si-rcons: `")
- + optarg + "'. Try --cegqi-si-rcons help.");
- }
-}
-
-theory::quantifiers::CegisSampleMode OptionsHandler::stringToCegisSampleMode(
- std::string option, std::string optarg)
-{
- if (optarg == "none")
- {
- return theory::quantifiers::CEGIS_SAMPLE_NONE;
- }
- else if (optarg == "use")
- {
- return theory::quantifiers::CEGIS_SAMPLE_USE;
- }
- else if (optarg == "trust")
- {
- return theory::quantifiers::CEGIS_SAMPLE_TRUST;
- }
- else if (optarg == "help")
- {
- puts(s_cegisSampleHelp.c_str());
- exit(1);
- }
- else
- {
- throw OptionException(std::string("unknown option for --cegis-sample: `")
- + optarg
- + "'. Try --cegis-sample help.");
- }
-}
-
-theory::quantifiers::SygusQueryDumpFilesMode
-OptionsHandler::stringToSygusQueryDumpFilesMode(std::string option,
- std::string optarg)
-{
- if (optarg == "none")
- {
- return theory::quantifiers::SYGUS_QUERY_DUMP_NONE;
- }
- else if (optarg == "all")
- {
- return theory::quantifiers::SYGUS_QUERY_DUMP_ALL;
- }
- else if (optarg == "unsolved")
- {
- return theory::quantifiers::SYGUS_QUERY_DUMP_UNSOLVED;
- }
- else if (optarg == "help")
- {
- puts(s_sygusQueryDumpFileHelp.c_str());
- exit(1);
- }
- else
- {
- throw OptionException(
- std::string("unknown option for --sygus-query-gen-dump-files: `")
- + optarg + "'. Try --sygus-query-gen-dump-files help.");
- }
-}
-theory::quantifiers::SygusFilterSolMode
-OptionsHandler::stringToSygusFilterSolMode(std::string option,
- std::string optarg)
+void OptionsHandler::checkInstWhenMode(std::string option, InstWhenMode mode)
{
- if (optarg == "none")
- {
- return theory::quantifiers::SYGUS_FILTER_SOL_NONE;
- }
- else if (optarg == "strong")
- {
- return theory::quantifiers::SYGUS_FILTER_SOL_STRONG;
- }
- else if (optarg == "weak")
+ if (mode == InstWhenMode::PRE_FULL)
{
- return theory::quantifiers::SYGUS_FILTER_SOL_WEAK;
- }
- else if (optarg == "help")
- {
- puts(s_sygusFilterSolHelp.c_str());
- exit(1);
- }
- else
- {
- throw OptionException(
- std::string("unknown option for --sygus-filter-sol: `") + optarg
- + "'. Try --sygus-filter-sol help.");
- }
-}
-
-theory::quantifiers::SygusInvTemplMode
-OptionsHandler::stringToSygusInvTemplMode(std::string option,
- std::string optarg)
-{
- if(optarg == "none" ) {
- return theory::quantifiers::SYGUS_INV_TEMPL_MODE_NONE;
- } else if(optarg == "pre") {
- return theory::quantifiers::SYGUS_INV_TEMPL_MODE_PRE;
- } else if(optarg == "post") {
- return theory::quantifiers::SYGUS_INV_TEMPL_MODE_POST;
- } else if(optarg == "help") {
- puts(s_sygusInvTemplHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --sygus-inv-templ: `") +
- optarg + "'. Try --sygus-inv-templ help.");
- }
-}
-
-theory::quantifiers::SygusActiveGenMode
-OptionsHandler::stringToSygusActiveGenMode(std::string option,
- std::string optarg)
-{
- if (optarg == "none")
- {
- return theory::quantifiers::SYGUS_ACTIVE_GEN_NONE;
- }
- else if (optarg == "basic")
- {
- return theory::quantifiers::SYGUS_ACTIVE_GEN_ENUM_BASIC;
- }
- else if (optarg == "enum")
- {
- return theory::quantifiers::SYGUS_ACTIVE_GEN_ENUM;
- }
- else if (optarg == "var-agnostic")
- {
- return theory::quantifiers::SYGUS_ACTIVE_GEN_VAR_AGNOSTIC;
- }
- else if (optarg == "auto")
- {
- return theory::quantifiers::SYGUS_ACTIVE_GEN_AUTO;
- }
- else if (optarg == "help")
- {
- puts(s_sygusActiveGenHelp.c_str());
- exit(1);
- }
- else
- {
- throw OptionException(std::string("unknown option for --sygus-inv-templ: `")
- + optarg + "'. Try --sygus-inv-templ help.");
- }
-}
-theory::quantifiers::SygusGrammarConsMode
-OptionsHandler::stringToSygusGrammarConsMode(std::string option,
- std::string optarg)
-{
- if (optarg == "simple")
- {
- return theory::quantifiers::SYGUS_GCONS_SIMPLE;
- }
- else if (optarg == "any-const")
- {
- return theory::quantifiers::SYGUS_GCONS_ANY_CONST;
- }
- else if (optarg == "any-term")
- {
- return theory::quantifiers::SYGUS_GCONS_ANY_TERM;
- }
- else if (optarg == "any-term-concise")
- {
- return theory::quantifiers::SYGUS_GCONS_ANY_TERM_CONCISE;
- }
- else if (optarg == "help")
- {
- puts(s_sygusGrammarConsHelp.c_str());
- exit(1);
- }
- else
- {
- throw OptionException(
- std::string("unknown option for --sygus-grammar-cons: `") + optarg
- + "'. Try --sygus-grammar-cons help.");
- }
-}
-
-theory::quantifiers::SygusUnifPiMode OptionsHandler::stringToSygusUnifPiMode(
- std::string option, std::string optarg)
-{
- if (optarg == "none")
- {
- return theory::quantifiers::SYGUS_UNIF_PI_NONE;
- }
- else if (optarg == "complete")
- {
- return theory::quantifiers::SYGUS_UNIF_PI_COMPLETE;
- }
- else if (optarg == "cond-enum")
- {
- return theory::quantifiers::SYGUS_UNIF_PI_CENUM;
- }
- else if (optarg == "cond-enum-igain")
- {
- return theory::quantifiers::SYGUS_UNIF_PI_CENUM_IGAIN;
- }
- else if (optarg == "help")
- {
- puts(s_sygusUnifPiHelp.c_str());
- exit(1);
- }
- else
- {
- throw OptionException(std::string("unknown option for --sygus-unif-pi: `")
- + optarg + "'. Try --sygus-unif-pi help.");
- }
-}
-
-theory::quantifiers::MacrosQuantMode OptionsHandler::stringToMacrosQuantMode(
- std::string option, std::string optarg)
-{
- if(optarg == "all" ) {
- return theory::quantifiers::MACROS_QUANT_MODE_ALL;
- } else if(optarg == "ground") {
- return theory::quantifiers::MACROS_QUANT_MODE_GROUND;
- } else if(optarg == "ground-uf") {
- return theory::quantifiers::MACROS_QUANT_MODE_GROUND_UF;
- } else if(optarg == "help") {
- puts(s_macrosQuantHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --macros-quant-mode: `") +
- optarg + "'. Try --macros-quant-mode help.");
- }
-}
-
-theory::quantifiers::QuantDSplitMode OptionsHandler::stringToQuantDSplitMode(
- std::string option, std::string optarg)
-{
- if(optarg == "none" ) {
- return theory::quantifiers::QUANT_DSPLIT_MODE_NONE;
- } else if(optarg == "default") {
- return theory::quantifiers::QUANT_DSPLIT_MODE_DEFAULT;
- } else if(optarg == "agg") {
- return theory::quantifiers::QUANT_DSPLIT_MODE_AGG;
- } else if(optarg == "help") {
- puts(s_quantDSplitHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --quant-dsplit-mode: `") +
- optarg + "'. Try --quant-dsplit-mode help.");
- }
-}
-
-theory::quantifiers::QuantRepMode OptionsHandler::stringToQuantRepMode(
- std::string option, std::string optarg)
-{
- if(optarg == "none" ) {
- return theory::quantifiers::QUANT_REP_MODE_EE;
- } else if(optarg == "first" || optarg == "default") {
- return theory::quantifiers::QUANT_REP_MODE_FIRST;
- } else if(optarg == "depth") {
- return theory::quantifiers::QUANT_REP_MODE_DEPTH;
- } else if(optarg == "help") {
- puts(s_quantRepHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --quant-rep-mode: `") +
- optarg + "'. Try --quant-rep-mode help.");
+ throw OptionException(std::string("Mode pre-full for ") + option
+ + " is not supported in this release.");
}
}
#ifndef CVC4_USE_ABC
if(value) {
std::stringstream ss;
- ss << "option `" << option << "' requires an abc-enabled build of CVC4; this binary was not built with abc support";
- throw OptionException(ss.str());
- }
-#endif /* CVC4_USE_ABC */
-}
-
-void OptionsHandler::abcEnabledBuild(std::string option, std::string value)
-{
-#ifndef CVC4_USE_ABC
- if(!value.empty()) {
- std::stringstream ss;
- ss << "option `" << option << "' requires an abc-enabled build of CVC4; this binary was not built with abc support";
- throw OptionException(ss.str());
- }
-#endif /* CVC4_USE_ABC */
-}
-
-void OptionsHandler::satSolverEnabledBuild(std::string option, bool value)
-{
-#if !defined(CVC4_USE_CRYPTOMINISAT) && !defined(CVC4_USE_CADICAL)
- if (value)
- {
- std::stringstream ss;
- ss << "option `" << option
- << "' requires a CVC4 to be built with CryptoMiniSat or CaDiCaL";
- throw OptionException(ss.str());
- }
-#endif
-}
-
-void OptionsHandler::satSolverEnabledBuild(std::string option,
- std::string value)
-{
-#if !defined(CVC4_USE_CRYPTOMINISAT) && !defined(CVC4_USE_CADICAL)
- if (!value.empty())
- {
- std::stringstream ss;
- ss << "option `" << option
- << "' requires a CVC4 to be built with CryptoMiniSat or CaDiCaL";
- throw OptionException(ss.str());
- }
-#endif
-}
-
-const std::string OptionsHandler::s_bvSatSolverHelp = "\
-Sat solvers currently supported by the --bv-sat-solver option:\n\
-\n\
-minisat (default)\n\
-\n\
-cadical\n\
-\n\
-cryptominisat\n\
-";
-
-theory::bv::SatSolverMode OptionsHandler::stringToSatSolver(std::string option,
- std::string optarg)
-{
- if(optarg == "minisat") {
- return theory::bv::SAT_SOLVER_MINISAT;
- } else if(optarg == "cryptominisat") {
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_LAZY &&
- options::bitblastMode.wasSetByUser()) {
- throwLazyBBUnsupported(theory::bv::SAT_SOLVER_CRYPTOMINISAT);
- }
- if (!options::bitvectorToBool.wasSetByUser()) {
- options::bitvectorToBool.set(true);
- }
- return theory::bv::SAT_SOLVER_CRYPTOMINISAT;
- }
- else if (optarg == "cadical")
- {
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_LAZY
- && options::bitblastMode.wasSetByUser())
- {
- throwLazyBBUnsupported(theory::bv::SAT_SOLVER_CADICAL);
- }
- if (!options::bitvectorToBool.wasSetByUser())
- {
- options::bitvectorToBool.set(true);
- }
- return theory::bv::SAT_SOLVER_CADICAL;
- } else if(optarg == "help") {
- puts(s_bvSatSolverHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --bv-sat-solver: `") +
- optarg + "'. Try --bv-sat-solver=help.");
- }
-}
-
-const std::string OptionsHandler::s_bvProofFormatHelp =
- "\
-Proof formats currently supported by the --bv-proof-format option:\n\
-\n\
- lrat : DRAT with unit propagation hints to accelerate checking (default)\n\
-\n\
- drat : Deletion and Resolution Asymmetric Tautology Additions \n\
-\n\
- er : Extended Resolution, i.e. resolution with new variable definitions\n\
-\n\
-This option controls which underlying UNSAT proof format is used in BV proofs.\n\
-\n\
-Note: Currently this option does nothing. BV proofs are a work in progress!\
-";
-
-theory::bv::BvProofFormat OptionsHandler::stringToBvProofFormat(
- std::string option, std::string optarg)
-{
- if (optarg == "er")
- {
- return theory::bv::BITVECTOR_PROOF_ER;
- }
- else if (optarg == "lrat")
- {
- return theory::bv::BITVECTOR_PROOF_LRAT;
- }
- else if (optarg == "drat")
- {
- return theory::bv::BITVECTOR_PROOF_DRAT;
- }
- else if (optarg == "help")
- {
- puts(s_bvProofFormatHelp.c_str());
- exit(1);
- }
- else
- {
- throw OptionException(std::string("unknown option for --bv-proof-format: `")
- + optarg + "'. Try --bv-proof-format=help.");
+ ss << "option `" << option << "' requires an abc-enabled build of CVC4; this binary was not built with abc support";
+ throw OptionException(ss.str());
}
+#endif /* CVC4_USE_ABC */
}
-const std::string OptionsHandler::s_bvOptimizeSatProofHelp =
- "\
-Optimization levels currently supported by the --bv-optimize-sat-proof option:\n\
-\n\
- none : Do not optimize the SAT proof\n\
-\n\
- proof : Use drat-trim to shrink the SAT proof\n\
-\n\
- formula : Use drat-trim to shrink the SAT proof and formula (default)\
-";
-
-theory::bv::BvOptimizeSatProof OptionsHandler::stringToBvOptimizeSatProof(
- std::string option, std::string optarg)
+void OptionsHandler::abcEnabledBuild(std::string option, std::string value)
{
- if (optarg == "none")
- {
- return theory::bv::BITVECTOR_OPTIMIZE_SAT_PROOF_NONE;
- }
- else if (optarg == "proof")
- {
- return theory::bv::BITVECTOR_OPTIMIZE_SAT_PROOF_PROOF;
- }
- else if (optarg == "formula")
- {
- return theory::bv::BITVECTOR_OPTIMIZE_SAT_PROOF_FORMULA;
- }
- else if (optarg == "help")
- {
- puts(s_bvOptimizeSatProofHelp.c_str());
- exit(1);
+#ifndef CVC4_USE_ABC
+ if(!value.empty()) {
+ std::stringstream ss;
+ ss << "option `" << option << "' requires an abc-enabled build of CVC4; this binary was not built with abc support";
+ throw OptionException(ss.str());
}
- else
+#endif /* CVC4_USE_ABC */
+}
+
+void OptionsHandler::checkBvSatSolver(std::string option, SatSolverMode m)
+{
+ if (m == SatSolverMode::CRYPTOMINISAT || m == SatSolverMode::CADICAL)
{
- throw OptionException(std::string("unknown option for --bv-optimize-sat-proof: `")
- + optarg + "'. Try --bv-optimize-sat-proof=help.");
+ if (options::bitblastMode() == options::BitblastMode::LAZY
+ && options::bitblastMode.wasSetByUser())
+ {
+ throwLazyBBUnsupported(m);
+ }
+ if (!options::bitvectorToBool.wasSetByUser())
+ {
+ options::bitvectorToBool.set(true);
+ }
}
}
-
-const std::string OptionsHandler::s_bitblastingModeHelp = "\
-Bit-blasting modes currently supported by the --bitblast option:\n\
-\n\
-lazy (default)\n\
-+ Separate boolean structure and term reasoning between the core\n\
- SAT solver and the bv SAT solver\n\
-\n\
-eager\n\
-+ Bitblast eagerly to bv SAT solver\n\
-";
-
-theory::bv::BitblastMode OptionsHandler::stringToBitblastMode(
- std::string option, std::string optarg)
+void OptionsHandler::checkBitblastMode(std::string option, BitblastMode m)
{
- if (optarg == "lazy")
+ if (m == options::BitblastMode::LAZY)
{
if (!options::bitvectorPropagate.wasSetByUser())
{
{
if (options::incrementalSolving() || options::produceModels())
{
- options::bitvectorEqualitySlicer.set(theory::bv::BITVECTOR_SLICER_OFF);
+ options::bitvectorEqualitySlicer.set(options::BvSlicerMode::OFF);
}
else
{
- options::bitvectorEqualitySlicer.set(theory::bv::BITVECTOR_SLICER_AUTO);
+ options::bitvectorEqualitySlicer.set(options::BvSlicerMode::AUTO);
}
}
{
options::bitvectorAlgebraicSolver.set(true);
}
- if (options::bvSatSolver() != theory::bv::SAT_SOLVER_MINISAT)
+ if (options::bvSatSolver() != options::SatSolverMode::MINISAT)
{
throwLazyBBUnsupported(options::bvSatSolver());
}
- return theory::bv::BITBLAST_MODE_LAZY;
}
- else if (optarg == "eager")
+ else if (m == BitblastMode::EAGER)
{
if (!options::bitvectorToBool.wasSetByUser())
{
options::bitvectorToBool.set(true);
}
- return theory::bv::BITBLAST_MODE_EAGER;
- }
- else if (optarg == "help")
- {
- puts(s_bitblastingModeHelp.c_str());
- exit(1);
- }
- else
- {
- throw OptionException(std::string("unknown option for --bitblast: `")
- + optarg + "'. Try --bitblast=help.");
- }
-}
-
-const std::string OptionsHandler::s_bvSlicerModeHelp = "\
-Bit-vector equality slicer modes supported by the --bv-eq-slicer option:\n\
-\n\
-auto (default)\n\
-+ Turn slicer on if input has only equalities over core symbols\n\
-\n\
-on\n\
-+ Turn slicer on\n\
-\n\
-off\n\
-+ Turn slicer off\n\
-";
-
-theory::bv::BvSlicerMode OptionsHandler::stringToBvSlicerMode(
- std::string option, std::string optarg)
-{
- if(optarg == "auto") {
- return theory::bv::BITVECTOR_SLICER_AUTO;
- } else if(optarg == "on") {
- return theory::bv::BITVECTOR_SLICER_ON;
- } else if(optarg == "off") {
- return theory::bv::BITVECTOR_SLICER_OFF;
- } else if(optarg == "help") {
- puts(s_bvSlicerModeHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --bv-eq-slicer: `") +
- optarg + "'. Try --bv-eq-slicer=help.");
- }
-}
-
-const std::string OptionsHandler::s_stringsProcessLoopModeHelp =
- "Loop processing modes supported by the --strings-process-loop-mode "
- "option:\n"
- "\n"
- "full (default)\n"
- "+ Perform full processing of looping word equations\n"
- "\n"
- "simple (default with --strings-fmf)\n"
- "+ Omit normal loop breaking\n"
- "\n"
- "simple-abort\n"
- "+ Abort when normal loop breaking is required\n"
- "\n"
- "none\n"
- "+ Omit loop processing\n"
- "\n"
- "abort\n"
- "+ Abort if looping word equations are encountered\n";
-
-theory::strings::ProcessLoopMode OptionsHandler::stringToStringsProcessLoopMode(
- std::string option, std::string optarg)
-{
- if (optarg == "full")
- {
- return theory::strings::ProcessLoopMode::FULL;
- }
- else if (optarg == "simple")
- {
- return theory::strings::ProcessLoopMode::SIMPLE;
- }
- else if (optarg == "simple-abort")
- {
- return theory::strings::ProcessLoopMode::SIMPLE_ABORT;
- }
- else if (optarg == "none")
- {
- return theory::strings::ProcessLoopMode::NONE;
- }
- else if (optarg == "abort")
- {
- return theory::strings::ProcessLoopMode::ABORT;
- }
- else if (optarg == "help")
- {
- puts(s_stringsProcessLoopModeHelp.c_str());
- exit(1);
- }
- else
- {
- throw OptionException(
- std::string("unknown option for --strings-process-loop-mode: `")
- + optarg + "'. Try --strings-process-loop-mode=help.");
- }
-}
-
-const std::string OptionsHandler::s_regExpInterModeHelp =
- "\
-Regular expression intersection modes supported by the --re-inter-mode option\
-\n\
-\n\
-all \n\
-+ Compute intersections for all regular expressions.\n\
-\n\
-constant (default)\n\
-+ Compute intersections only between regular expressions that do not contain\
-re.allchar or re.range\n\
-\n\
-one-constant\n\
-+ Compute intersections only between regular expressions such that at least one\
-side does not contain re.allchar or re.range\n\
-\n\
-none\n\
-+ Do not compute intersections for regular expressions\n\
-";
-
-theory::strings::RegExpInterMode OptionsHandler::stringToRegExpInterMode(
- std::string option, std::string optarg)
-{
- if (optarg == "all")
- {
- return theory::strings::RegExpInterMode::RE_INTER_ALL;
- }
- else if (optarg == "constant")
- {
- return theory::strings::RegExpInterMode::RE_INTER_CONSTANT;
- }
- else if (optarg == "one-constant")
- {
- return theory::strings::RegExpInterMode::RE_INTER_ONE_CONSTANT;
- }
- else if (optarg == "none")
- {
- return theory::strings::RegExpInterMode::RE_INTER_NONE;
- }
- else if (optarg == "help")
- {
- puts(s_regExpInterModeHelp.c_str());
- exit(1);
- }
- else
- {
- throw OptionException(std::string("unknown option for --re-inter-mode: `")
- + optarg + "'. Try --re-inter-mode=help.");
- }
-}
-
-const std::string OptionsHandler::s_boolToBVModeHelp =
- "\
-BoolToBV pass modes supported by the --bool-to-bv option:\n\
-\n\
-off (default)\n\
-+ Don't push any booleans to width one bit-vectors\n\
-\n\
-ite\n\
-+ Try to turn ITEs into BITVECTOR_ITE when possible. It can fail per-formula \n\
- if not all sub-formulas can be turned to bit-vectors\n\
-\n\
-all\n\
-+ Force all booleans to be bit-vectors of width one except at the top level.\n\
- Most aggressive mode\n\
-";
-
-preprocessing::passes::BoolToBVMode OptionsHandler::stringToBoolToBVMode(
- std::string option, std::string optarg)
-{
- if (optarg == "off")
- {
- return preprocessing::passes::BOOL_TO_BV_OFF;
- }
- else if (optarg == "ite")
- {
- return preprocessing::passes::BOOL_TO_BV_ITE;
- }
- else if (optarg == "all")
- {
- return preprocessing::passes::BOOL_TO_BV_ALL;
- }
- else if (optarg == "help")
- {
- puts(s_boolToBVModeHelp.c_str());
- exit(1);
- }
- else
- {
- throw OptionException(std::string("unknown option for --bool-to-bv: `")
- + optarg
- + "'. Try --bool-to-bv=help");
}
}
{
if(arg) {
if(options::bitblastMode.wasSetByUser()) {
- if(options::bitblastMode() != theory::bv::BITBLAST_MODE_EAGER) {
+ if (options::bitblastMode() != options::BitblastMode::EAGER)
+ {
throw OptionException("bitblast-aig must be used with eager bitblaster");
}
} else {
- theory::bv::BitblastMode mode = stringToBitblastMode("", "eager");
+ options::BitblastMode mode = stringToBitblastMode("", "eager");
options::bitblastMode.set(mode);
}
if(!options::bitvectorAigSimplifications.wasSetByUser()) {
}
}
-// theory/uf/options_handlers.h
-const std::string OptionsHandler::s_ufssModeHelp = "\
-UF with cardinality options currently supported by the --uf-ss option when\n\
-combined with finite model finding:\n\
-\n\
-full \n\
-+ Default, use UF with cardinality to find minimal models for uninterpreted\n\
-sorts.\n\
-\n\
-no-minimal \n\
-+ Use UF with cardinality to shrink models, but do no enforce minimality.\n\
-\n\
-none \n\
-+ Do not use UF with cardinality to shrink model sizes. \n\
-\n\
-";
-
-theory::uf::UfssMode OptionsHandler::stringToUfssMode(std::string option,
- std::string optarg)
-{
- if(optarg == "default" || optarg == "full" ) {
- return theory::uf::UF_SS_FULL;
- } else if(optarg == "no-minimal") {
- return theory::uf::UF_SS_NO_MINIMAL;
- } else if(optarg == "none") {
- return theory::uf::UF_SS_NONE;
- } else if(optarg == "help") {
- puts(s_ufssModeHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --uf-ss: `") +
- optarg + "'. Try --uf-ss help.");
- }
-}
-
-
-
-// theory/options_handlers.h
-const std::string OptionsHandler::s_theoryOfModeHelp = "\
-TheoryOf modes currently supported by the --theoryof-mode option:\n\
-\n\
-type (default) \n\
-+ type variables, constants and equalities by type\n\
-\n\
-term \n\
-+ type variables as uninterpreted, equalities by the parametric theory\n\
-";
-
-theory::TheoryOfMode OptionsHandler::stringToTheoryOfMode(std::string option, std::string optarg) {
- if(optarg == "type") {
- return theory::THEORY_OF_TYPE_BASED;
- } else if(optarg == "term") {
- return theory::THEORY_OF_TERM_BASED;
- } else if(optarg == "help") {
- puts(s_theoryOfModeHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --theoryof-mode: `") +
- optarg + "'. Try --theoryof-mode help.");
- }
-}
-
// theory/options_handlers.h
std::string OptionsHandler::handleUseTheoryList(std::string option, std::string optarg) {
std::string currentList = options::useTheoryList();
d_options->d_useTheoryListListeners.notify();
}
-
-
// printer/options_handlers.h
-const std::string OptionsHandler::s_modelFormatHelp = "\
-Model format modes currently supported by the --model-format option:\n\
-\n\
-default \n\
-+ Print model as expressions in the output language format.\n\
-\n\
-table\n\
-+ Print functional expressions over finite domains in a table format.\n\
-";
-
const std::string OptionsHandler::s_instFormatHelp = "\
Inst format modes currently supported by the --inst-format option:\n\
\n\
+ Print instantiations as SZS compliant proof.\n\
";
-ModelFormatMode OptionsHandler::stringToModelFormatMode(std::string option,
- std::string optarg)
-{
- if(optarg == "default") {
- return MODEL_FORMAT_MODE_DEFAULT;
- } else if(optarg == "table") {
- return MODEL_FORMAT_MODE_TABLE;
- } else if(optarg == "help") {
- puts(s_modelFormatHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --model-format: `") +
- optarg + "'. Try --model-format help.");
- }
-}
-
InstFormatMode OptionsHandler::stringToInstFormatMode(std::string option,
std::string optarg)
{
if(optarg == "default") {
- return INST_FORMAT_MODE_DEFAULT;
+ return InstFormatMode::DEFAULT;
} else if(optarg == "szs") {
- return INST_FORMAT_MODE_SZS;
+ return InstFormatMode::SZS;
} else if(optarg == "help") {
puts(s_instFormatHelp.c_str());
exit(1);
}
}
-
// decision/options_handlers.h
-const std::string OptionsHandler::s_decisionModeHelp = "\
-Decision modes currently supported by the --decision option:\n\
-\n\
-internal (default)\n\
-+ Use the internal decision heuristics of the SAT solver\n\
-\n\
-justification\n\
-+ An ATGP-inspired justification heuristic\n\
-\n\
-justification-stoponly\n\
-+ Use the justification heuristic only to stop early, not for decisions\n\
-";
-
-decision::DecisionMode OptionsHandler::stringToDecisionMode(std::string option,
- std::string optarg)
-{
- options::decisionStopOnly.set(false);
-
- if(optarg == "internal") {
- return decision::DECISION_STRATEGY_INTERNAL;
- } else if(optarg == "justification") {
- return decision::DECISION_STRATEGY_JUSTIFICATION;
- } else if(optarg == "justification-stoponly") {
- options::decisionStopOnly.set(true);
- return decision::DECISION_STRATEGY_JUSTIFICATION;
- } else if(optarg == "help") {
- puts(s_decisionModeHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --decision: `") +
- optarg + "'. Try --decision help.");
- }
-}
-
-decision::DecisionWeightInternal OptionsHandler::stringToDecisionWeightInternal(
- std::string option, std::string optarg)
-{
- if(optarg == "off")
- return decision::DECISION_WEIGHT_INTERNAL_OFF;
- else if(optarg == "max")
- return decision::DECISION_WEIGHT_INTERNAL_MAX;
- else if(optarg == "sum")
- return decision::DECISION_WEIGHT_INTERNAL_SUM;
- else if(optarg == "usr1")
- return decision::DECISION_WEIGHT_INTERNAL_USR1;
- else
- throw OptionException(std::string("--decision-weight-internal must be off, max or sum."));
-}
-
-
-// smt/options_handlers.h
-const std::string OptionsHandler::s_simplificationHelp = "\
-Simplification modes currently supported by the --simplification option:\n\
-\n\
-batch (default) \n\
-+ save up all ASSERTions; run nonclausal simplification and clausal\n\
- (MiniSat) propagation for all of them only after reaching a querying command\n\
- (CHECKSAT or QUERY or predicate SUBTYPE declaration)\n\
-\n\
-none\n\
-+ do not perform nonclausal simplification\n\
-";
-
-SimplificationMode OptionsHandler::stringToSimplificationMode(
- std::string option, std::string optarg)
-{
- if(optarg == "batch") {
- return SIMPLIFICATION_MODE_BATCH;
- } else if(optarg == "none") {
- return SIMPLIFICATION_MODE_NONE;
- } else if(optarg == "help") {
- puts(s_simplificationHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --simplification: `") +
- optarg + "'. Try --simplification help.");
- }
-}
-
-const std::string OptionsHandler::s_modelCoresHelp =
- "\
-Model cores modes currently supported by the --model-cores option:\n\
-\n\
-none (default) \n\
-+ do not compute model cores\n\
-\n\
-simple\n\
-+ only include a subset of variables whose values are sufficient to show the\n\
-input formula is satisfied by the given model\n\
-\n\
-non-implied\n\
-+ only include a subset of variables whose values, in addition to the values\n\
-of variables whose values are implied, are sufficient to show the input\n\
-formula is satisfied by the given model\n\
-\n\
-";
-
-ModelCoresMode OptionsHandler::stringToModelCoresMode(std::string option,
- std::string optarg)
-{
- if (optarg == "none")
- {
- return MODEL_CORES_NONE;
- }
- else if (optarg == "simple")
- {
- return MODEL_CORES_SIMPLE;
- }
- else if (optarg == "non-implied")
- {
- return MODEL_CORES_NON_IMPLIED;
- }
- else if (optarg == "help")
- {
- puts(s_modelCoresHelp.c_str());
- exit(1);
- }
- else
- {
- throw OptionException(std::string("unknown option for --model-cores: `")
- + optarg + "'. Try --model-cores help.");
- }
-}
-
-const std::string OptionsHandler::s_blockModelsHelp =
- "\
-Blocking models modes are currently supported by the --block-models option:\n\
-\n\
-none (default) \n\
-+ do not block models\n\
-\n\
-literals\n\
-+ block models based on the SAT skeleton\n\
-\n\
-values\n\
-+ block models based on the concrete model values for the free variables.\n\
-\n\
-";
-
-BlockModelsMode OptionsHandler::stringToBlockModelsMode(std::string option,
- std::string optarg)
-{
- if (optarg == "none")
- {
- return BLOCK_MODELS_NONE;
- }
- else if (optarg == "literals")
- {
- return BLOCK_MODELS_LITERALS;
- }
- else if (optarg == "values")
- {
- return BLOCK_MODELS_VALUES;
- ;
- }
- else if (optarg == "help")
- {
- puts(s_blockModelsHelp.c_str());
- exit(1);
- }
- else
- {
- throw OptionException(std::string("unknown option for --block-models: `")
- + optarg + "'. Try --block-models help.");
- }
-}
-
-const std::string OptionsHandler::s_sygusSolutionOutModeHelp =
- "\
-Modes for sygus solution output, supported by --sygus-out:\n\
-\n\
-status \n\
-+ Print only status for check-synth calls.\n\
-\n\
-status-and-def (default) \n\
-+ Print status followed by definition corresponding to solution.\n\
-\n\
-status-or-def \n\
-+ Print status if infeasible, or definition corresponding to\n\
- solution if feasible.\n\
-\n\
-sygus-standard \n\
-+ Print based on SyGuS standard.\n\
-\n\
-";
-
-SygusSolutionOutMode OptionsHandler::stringToSygusSolutionOutMode(
- std::string option, std::string optarg)
+void OptionsHandler::setDecisionModeStopOnly(std::string option, DecisionMode m)
{
- if (optarg == "status")
- {
- return SYGUS_SOL_OUT_STATUS;
- }
- else if (optarg == "status-and-def")
- {
- return SYGUS_SOL_OUT_STATUS_AND_DEF;
- }
- else if (optarg == "status-or-def")
- {
- return SYGUS_SOL_OUT_STATUS_OR_DEF;
- }
- else if (optarg == "sygus-standard")
- {
- return SYGUS_SOL_OUT_STANDARD;
- }
- else if (optarg == "help")
- {
- puts(s_sygusSolutionOutModeHelp.c_str());
- exit(1);
- }
- else
- {
- throw OptionException(std::string("unknown option for --sygus-out: `")
- + optarg
- + "'. Try --sygus-out help.");
- }
+ options::decisionStopOnly.set(m == DecisionMode::RELEVANCY);
}
void OptionsHandler::setProduceAssertions(std::string option, bool value)
void OptionsHandler::proofEnabledBuild(std::string option, bool value)
{
#ifdef CVC4_PROOF
- if (value && options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER
- && options::bvSatSolver() != theory::bv::SAT_SOLVER_MINISAT
- && options::bvSatSolver() != theory::bv::SAT_SOLVER_CRYPTOMINISAT)
+ if (value && options::bitblastMode() == options::BitblastMode::EAGER
+ && options::bvSatSolver() != options::SatSolverMode::MINISAT
+ && options::bvSatSolver() != options::SatSolverMode::CRYPTOMINISAT)
{
throw OptionException(
"Eager BV proofs only supported when MiniSat or CryptoMiniSat is used");
#include <string>
#include "base/modal_exception.h"
-#include "options/arith_heuristic_pivot_rule.h"
-#include "options/arith_propagation_mode.h"
-#include "options/arith_unate_lemma_mode.h"
#include "options/base_handlers.h"
-#include "options/bool_to_bv_mode.h"
-#include "options/bv_bitblast_mode.h"
-#include "options/datatypes_modes.h"
-#include "options/decision_mode.h"
+#include "options/bv_options.h"
+#include "options/decision_options.h"
#include "options/language.h"
#include "options/option_exception.h"
#include "options/options.h"
#include "options/printer_modes.h"
-#include "options/quantifiers_modes.h"
-#include "options/smt_modes.h"
-#include "options/strings_modes.h"
-#include "options/sygus_out_mode.h"
-#include "options/theoryof_mode.h"
-#include "options/ufss_mode.h"
+#include "options/quantifiers_options.h"
namespace CVC4 {
namespace options {
options::less_equal(1.0)(option, value);
}
- // theory/arith/options_handlers.h
- ArithUnateLemmaMode stringToArithUnateLemmaMode(std::string option,
- std::string optarg);
- ArithPropagationMode stringToArithPropagationMode(std::string option,
- std::string optarg);
- ErrorSelectionRule stringToErrorSelectionRule(std::string option,
- std::string optarg);
-
// theory/quantifiers/options_handlers.h
- theory::quantifiers::InstWhenMode stringToInstWhenMode(std::string option,
- std::string optarg);
- void checkInstWhenMode(std::string option,
- theory::quantifiers::InstWhenMode mode);
- theory::quantifiers::LiteralMatchMode stringToLiteralMatchMode(
- std::string option, std::string optarg);
- void checkLiteralMatchMode(std::string option,
- theory::quantifiers::LiteralMatchMode mode);
- theory::quantifiers::MbqiMode stringToMbqiMode(std::string option,
- std::string optarg);
- void checkMbqiMode(std::string option, theory::quantifiers::MbqiMode mode);
- theory::quantifiers::QcfWhenMode stringToQcfWhenMode(std::string option,
- std::string optarg);
- theory::quantifiers::QcfMode stringToQcfMode(std::string option,
- std::string optarg);
- theory::quantifiers::UserPatMode stringToUserPatMode(std::string option,
- std::string optarg);
- theory::quantifiers::TriggerSelMode stringToTriggerSelMode(
- std::string option, std::string optarg);
- theory::quantifiers::TriggerActiveSelMode stringToTriggerActiveSelMode(
- std::string option, std::string optarg);
- theory::quantifiers::PrenexQuantMode stringToPrenexQuantMode(
- std::string option, std::string optarg);
- theory::quantifiers::TermDbMode stringToTermDbMode(std::string option,
- std::string optarg);
- theory::quantifiers::IteLiftQuantMode stringToIteLiftQuantMode(
- std::string option, std::string optarg);
- theory::quantifiers::CbqiBvIneqMode stringToCbqiBvIneqMode(
- std::string option, std::string optarg);
- theory::quantifiers::CegqiSingleInvMode stringToCegqiSingleInvMode(
- std::string option, std::string optarg);
- theory::quantifiers::CegqiSingleInvRconsMode stringToCegqiSingleInvRconsMode(
- std::string option, std::string optarg);
- theory::quantifiers::CegisSampleMode stringToCegisSampleMode(
- std::string option, std::string optarg);
- theory::quantifiers::SygusQueryDumpFilesMode stringToSygusQueryDumpFilesMode(
- std::string option, std::string optarg);
- theory::quantifiers::SygusFilterSolMode stringToSygusFilterSolMode(
- std::string option, std::string optarg);
- theory::quantifiers::SygusInvTemplMode stringToSygusInvTemplMode(
- std::string option, std::string optarg);
- theory::quantifiers::SygusActiveGenMode stringToSygusActiveGenMode(
- std::string option, std::string optarg);
- theory::quantifiers::SygusUnifPiMode stringToSygusUnifPiMode(
- std::string option, std::string optarg);
- theory::quantifiers::SygusGrammarConsMode stringToSygusGrammarConsMode(
- std::string option, std::string optarg);
- theory::quantifiers::MacrosQuantMode stringToMacrosQuantMode(
- std::string option, std::string optarg);
- theory::quantifiers::QuantDSplitMode stringToQuantDSplitMode(
- std::string option, std::string optarg);
- theory::quantifiers::QuantRepMode stringToQuantRepMode(std::string option,
- std::string optarg);
- theory::SygusFairMode stringToSygusFairMode(std::string option,
- std::string optarg);
+ void checkInstWhenMode(std::string option, InstWhenMode mode);
// theory/bv/options_handlers.h
void abcEnabledBuild(std::string option, bool value);
void abcEnabledBuild(std::string option, std::string value);
- void satSolverEnabledBuild(std::string option, bool value);
- void satSolverEnabledBuild(std::string option, std::string optarg);
-
- theory::bv::BitblastMode stringToBitblastMode(std::string option,
- std::string optarg);
- theory::bv::BvSlicerMode stringToBvSlicerMode(std::string option,
- std::string optarg);
- preprocessing::passes::BoolToBVMode stringToBoolToBVMode(std::string option,
- std::string optarg);
- void setBitblastAig(std::string option, bool arg);
-
- theory::bv::SatSolverMode stringToSatSolver(std::string option,
- std::string optarg);
- theory::bv::BvProofFormat stringToBvProofFormat(std::string option,
- std::string optarg);
- theory::bv::BvOptimizeSatProof stringToBvOptimizeSatProof(std::string option,
- std::string optarg);
+ template<class T> void checkSatSolverEnabled(std::string option, T m);
- theory::strings::ProcessLoopMode stringToStringsProcessLoopMode(
- std::string option, std::string optarg);
- theory::strings::RegExpInterMode stringToRegExpInterMode(std::string option,
- std::string optarg);
+ void checkBvSatSolver(std::string option, SatSolverMode m);
+ void checkBitblastMode(std::string option, BitblastMode m);
- // theory/uf/options_handlers.h
- theory::uf::UfssMode stringToUfssMode(std::string option, std::string optarg);
+ void setBitblastAig(std::string option, bool arg);
// theory/options_handlers.h
- theory::TheoryOfMode stringToTheoryOfMode(std::string option, std::string optarg);
void notifyUseTheoryList(std::string option);
std::string handleUseTheoryList(std::string option, std::string optarg);
-
// printer/options_handlers.h
- ModelFormatMode stringToModelFormatMode(std::string option,
- std::string optarg);
InstFormatMode stringToInstFormatMode(std::string option, std::string optarg);
// decision/options_handlers.h
- decision::DecisionMode stringToDecisionMode(std::string option,
- std::string optarg);
- decision::DecisionWeightInternal stringToDecisionWeightInternal(
- std::string option, std::string optarg);
+ void setDecisionModeStopOnly(std::string option, DecisionMode m);
/**
* Throws a ModalException if this option is being set after final
*/
void notifyBeforeSearch(const std::string& option);
void notifyDumpMode(std::string option);
- SimplificationMode stringToSimplificationMode(std::string option,
- std::string optarg);
- ModelCoresMode stringToModelCoresMode(std::string option, std::string optarg);
- BlockModelsMode stringToBlockModelsMode(std::string option,
- std::string optarg);
- SygusSolutionOutMode stringToSygusSolutionOutMode(std::string option,
- std::string optarg);
void setProduceAssertions(std::string option, bool value);
void proofEnabledBuild(std::string option, bool value);
void LFSCEnabledBuild(std::string option, bool value);
Options* d_options;
/* Help strings */
- static const std::string s_bitblastingModeHelp;
- static const std::string s_bvSatSolverHelp;
- static const std::string s_bvProofFormatHelp;
- static const std::string s_bvOptimizeSatProofHelp;
- static const std::string s_booleanTermConversionModeHelp;
- static const std::string s_bvSlicerModeHelp;
- static const std::string s_stringsProcessLoopModeHelp;
- static const std::string s_regExpInterModeHelp;
- static const std::string s_boolToBVModeHelp;
- static const std::string s_cegqiFairModeHelp;
- static const std::string s_decisionModeHelp;
- static const std::string s_instFormatHelp ;
- static const std::string s_instWhenHelp;
- static const std::string s_iteLiftQuantHelp;
- static const std::string s_literalMatchHelp;
- static const std::string s_macrosQuantHelp;
- static const std::string s_quantDSplitHelp;
- static const std::string s_quantRepHelp;
- static const std::string s_mbqiModeHelp;
- static const std::string s_modelFormatHelp;
- static const std::string s_prenexQuantModeHelp;
- static const std::string s_qcfModeHelp;
- static const std::string s_qcfWhenModeHelp;
- static const std::string s_simplificationHelp;
- static const std::string s_modelCoresHelp;
- static const std::string s_blockModelsHelp;
- static const std::string s_sygusSolutionOutModeHelp;
- static const std::string s_cbqiBvIneqModeHelp;
- static const std::string s_cegqiSingleInvHelp;
- static const std::string s_cegqiSingleInvRconsHelp;
- static const std::string s_cegisSampleHelp;
- static const std::string s_sygusQueryDumpFileHelp;
- static const std::string s_sygusFilterSolHelp;
- static const std::string s_sygusInvTemplHelp;
- static const std::string s_sygusActiveGenHelp;
- static const std::string s_sygusUnifPiHelp;
- static const std::string s_sygusGrammarConsHelp;
- static const std::string s_termDbModeHelp;
- static const std::string s_theoryOfModeHelp;
- static const std::string s_triggerSelModeHelp;
- static const std::string s_triggerActiveSelModeHelp;
- static const std::string s_ufssModeHelp;
- static const std::string s_userPatModeHelp;
- static const std::string s_fmfBoundMinModeModeHelp;
- static const std::string s_errorSelectionRulesHelp;
- static const std::string s_arithPropagationModeHelp;
- static const std::string s_arithUnateLemmasHelp;
+ static const std::string s_instFormatHelp;
}; /* class OptionHandler */
+template<class T>
+void OptionsHandler::checkSatSolverEnabled(std::string option, T m)
+{
+#if !defined(CVC4_USE_CRYPTOMINISAT) && !defined(CVC4_USE_CADICAL)
+ std::stringstream ss;
+ ss << "option `" << option
+ << "' requires CVC4 to be built with CryptoMiniSat or CaDiCaL";
+ throw OptionException(ss.str());
+#endif
+}
}/* CVC4::options namespace */
}/* CVC4 namespace */
return (*this)[options::inputLanguage];
}
-InstFormatMode Options::getInstFormatMode() const {
+options::InstFormatMode Options::getInstFormatMode() const
+{
return (*this)[options::instFormatMode];
}
namespace CVC4 {
-std::ostream& operator<<(std::ostream& out, ModelFormatMode mode) {
- switch(mode) {
- case MODEL_FORMAT_MODE_DEFAULT:
- out << "MODEL_FORMAT_MODE_DEFAULT";
- break;
- case MODEL_FORMAT_MODE_TABLE:
- out << "MODEL_FORMAT_MODE_TABLE";
- break;
- default:
- out << "ModelFormatMode:UNKNOWN![" << unsigned(mode) << "]";
- }
-
- return out;
-}
-
-std::ostream& operator<<(std::ostream& out, InstFormatMode mode) {
- switch(mode) {
- case INST_FORMAT_MODE_DEFAULT:
- out << "INST_FORMAT_MODE_DEFAULT";
- break;
- case INST_FORMAT_MODE_SZS:
- out << "INST_FORMAT_MODE_SZS";
- break;
- default:
- out << "InstFormatMode:UNKNOWN![" << unsigned(mode) << "]";
+std::ostream& operator<<(std::ostream& out, options::InstFormatMode mode)
+{
+ out << "InstFormatMode::";
+ switch (mode)
+ {
+ case options::InstFormatMode::DEFAULT: out << "DEFAULT"; break;
+ case options::InstFormatMode::SZS: out << "SZS"; break;
+ default: out << "UNKNOWN![" << unsigned(mode) << "]";
}
return out;
}
-}/* CVC4 namespace */
+} // namespace CVC4
#include <iostream>
namespace CVC4 {
+namespace options {
-/** Enumeration of model_format modes (how to print models from get-model command). */
-enum CVC4_PUBLIC ModelFormatMode {
+/** Enumeration of inst_format modes (how to print models from get-model
+ * command). */
+enum class CVC4_PUBLIC InstFormatMode
+{
/** default mode (print expressions in the output language format) */
- MODEL_FORMAT_MODE_DEFAULT,
- /** print functional values in a table format */
- MODEL_FORMAT_MODE_TABLE,
-};
-
-/** Enumeration of inst_format modes (how to print models from get-model command). */
-enum CVC4_PUBLIC InstFormatMode {
- /** default mode (print expressions in the output language format) */
- INST_FORMAT_MODE_DEFAULT,
+ DEFAULT,
/** print as SZS proof */
- INST_FORMAT_MODE_SZS,
+ SZS,
};
-std::ostream& operator<<(std::ostream& out, ModelFormatMode mode) CVC4_PUBLIC;
-std::ostream& operator<<(std::ostream& out, InstFormatMode mode) CVC4_PUBLIC;
+} // namespace options
+
+std::ostream& operator<<(std::ostream& out,
+ options::InstFormatMode mode) CVC4_PUBLIC;
-}/* CVC4 namespace */
+} // namespace CVC4
#endif /* CVC4__PRINTER__MODEL_FORMAT_H */
category = "regular"
long = "model-format=MODE"
type = "ModelFormatMode"
- default = "MODEL_FORMAT_MODE_DEFAULT"
- handler = "stringToModelFormatMode"
- includes = ["options/printer_modes.h"]
+ default = "DEFAULT"
help = "print format mode for models, see --model-format=help"
+ help_mode = "Model format modes."
+[[option.mode.DEFAULT]]
+ name = "default"
+ help = "Print model as expressions in the output language format."
+[[option.mode.TABLE]]
+ name = "table"
+ help = "Print functional expressions over finite domains in a table format."
[[option]]
name = "instFormatMode"
category = "regular"
long = "inst-format=MODE"
type = "InstFormatMode"
- default = "INST_FORMAT_MODE_DEFAULT"
+ default = "InstFormatMode::DEFAULT"
handler = "stringToInstFormatMode"
includes = ["options/printer_modes.h"]
help = "print format mode for instantiations, see --inst-format=help"
+# InstFormatMode is currently exported as public so we can't auto genenerate
+# the enum.
+# help_mode = "Inst format modes."
+#[[option.mode.DEFAULT]]
+# name = "default"
+# help = "Print instantiations as a list in the output language format."
+#[[option.mode.SZS]]
+# name = "szs"
+# help = "Print instantiations as SZS compliant proof."
[[option]]
name = "flattenHOChains"
+++ /dev/null
-/********************* */
-/*! \file quantifiers_modes.cpp
- ** \verbatim
- ** Top contributors (to current version):
- ** Morgan Deters, Andrew Reynolds
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief [[ Add one-line brief description here ]]
- **
- ** [[ Add lengthier description here ]]
- ** \todo document this file
- **/
-#include "options/quantifiers_modes.h"
-
-#include <iostream>
-
-namespace CVC4 {
-
-std::ostream& operator<<(std::ostream& out, theory::quantifiers::InstWhenMode mode) {
- switch(mode) {
- case theory::quantifiers::INST_WHEN_PRE_FULL:
- out << "INST_WHEN_PRE_FULL";
- break;
- case theory::quantifiers::INST_WHEN_FULL:
- out << "INST_WHEN_FULL";
- break;
- case theory::quantifiers::INST_WHEN_FULL_LAST_CALL:
- out << "INST_WHEN_FULL_LAST_CALL";
- break;
- case theory::quantifiers::INST_WHEN_LAST_CALL:
- out << "INST_WHEN_LAST_CALL";
- break;
- default:
- out << "InstWhenMode!UNKNOWN";
- }
-
- return out;
-}
-
-std::ostream& operator<<(std::ostream& out, theory::quantifiers::LiteralMatchMode mode) {
- switch(mode) {
- case theory::quantifiers::LITERAL_MATCH_NONE:
- out << "LITERAL_MATCH_NONE";
- break;
- case theory::quantifiers::LITERAL_MATCH_USE:
- out << "LITERAL_MATCH_USE";
- break;
- case theory::quantifiers::LITERAL_MATCH_AGG_PREDICATE:
- out << "LITERAL_MATCH_AGG_PREDICATE";
- break;
- case theory::quantifiers::LITERAL_MATCH_AGG:
- out << "LITERAL_MATCH_AGG";
- break;
- default:
- out << "LiteralMatchMode!UNKNOWN";
- }
-
- return out;
-}
-
-std::ostream& operator<<(std::ostream& out, theory::quantifiers::MbqiMode mode) {
- switch(mode) {
- case theory::quantifiers::MBQI_NONE:
- out << "MBQI_NONE";
- break;
- case theory::quantifiers::MBQI_FMC:
- out << "MBQI_FMC";
- break;
- case theory::quantifiers::MBQI_TRUST:
- out << "MBQI_TRUST";
- break;
- default:
- out << "MbqiMode!UNKNOWN";
- }
- return out;
-}
-
-}/* CVC4 namespace */
+++ /dev/null
-/********************* */
-/*! \file quantifiers_modes.h
- ** \verbatim
- ** Top contributors (to current version):
- ** Andrew Reynolds, Tim King, Morgan Deters
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief [[ Add one-line brief description here ]]
- **
- ** [[ Add lengthier description here ]]
- ** \todo document this file
- **/
-
-#include "cvc4_public.h"
-
-#ifndef CVC4__BASE__QUANTIFIERS_MODES_H
-#define CVC4__BASE__QUANTIFIERS_MODES_H
-
-#include <iostream>
-
-namespace CVC4 {
-namespace theory {
-namespace quantifiers {
-
-enum InstWhenMode {
- /** Apply instantiation round before full effort (possibly at standard effort) */
- INST_WHEN_PRE_FULL,
- /** Apply instantiation round at full effort or above */
- INST_WHEN_FULL,
- /** Apply instantiation round at full effort, after all other theories finish, or above */
- INST_WHEN_FULL_DELAY,
- /** Apply instantiation round at full effort half the time, and last call always */
- INST_WHEN_FULL_LAST_CALL,
- /** Apply instantiation round at full effort after all other theories finish half the time, and last call always */
- INST_WHEN_FULL_DELAY_LAST_CALL,
- /** Apply instantiation round at last call only */
- INST_WHEN_LAST_CALL,
-};
-
-enum LiteralMatchMode {
- /** Do not consider polarity of patterns */
- LITERAL_MATCH_NONE,
- /** Conservatively consider polarity of patterns */
- LITERAL_MATCH_USE,
- /** Aggressively consider polarity of Boolean predicates */
- LITERAL_MATCH_AGG_PREDICATE,
- /** Aggressively consider polarity of all terms */
- LITERAL_MATCH_AGG,
-};
-
-enum MbqiMode {
- /** no mbqi */
- MBQI_NONE,
- /** default, mbqi from Section 5.4.2 of AJR thesis */
- MBQI_FMC,
- /** mbqi trust (produce no instantiations) */
- MBQI_TRUST,
-};
-
-enum QcfWhenMode {
- /** default, apply at full effort */
- QCF_WHEN_MODE_DEFAULT,
- /** apply at last call */
- QCF_WHEN_MODE_LAST_CALL,
- /** apply at standard effort */
- QCF_WHEN_MODE_STD,
- /** apply based on heuristics */
- QCF_WHEN_MODE_STD_H,
-};
-
-enum QcfMode {
- /** default, use qcf for conflicts only */
- QCF_CONFLICT_ONLY,
- /** use qcf for conflicts and propagations */
- QCF_PROP_EQ,
- /** use qcf for conflicts, propagations and heuristic instantiations */
- QCF_PARTIAL,
-};
-
-/** User pattern mode.
-*
-* These modes determine how user provided patterns (triggers) are
-* used during E-matching. The modes vary on when instantiation based on
-* user-provided triggers is combined with instantiation based on
-* automatically selected triggers.
-*/
-enum UserPatMode
-{
- /** First instantiate based on user-provided triggers. If no instantiations
- * are produced, use automatically selected triggers.
- */
- USER_PAT_MODE_USE,
- /** Default, if triggers are supplied for a quantifier, use only those. */
- USER_PAT_MODE_TRUST,
- /** Resort to user triggers only when no instantiations are
- * produced by automatically selected triggers
- */
- USER_PAT_MODE_RESORT,
- /** Ignore user patterns. */
- USER_PAT_MODE_IGNORE,
- /** Interleave use/resort modes for quantified formulas with user patterns. */
- USER_PAT_MODE_INTERLEAVE,
-};
-
-/** Trigger selection mode.
-*
-* These modes are used for determining which terms to select
-* as triggers for quantified formulas, when necessary, during E-matching.
-* In the following, note the following terminology. A trigger is a set of terms,
-* where a single trigger is a singleton set and a multi-trigger is a set of more
-* than one term.
-*
-* TRIGGER_SEL_MIN selects single triggers of minimal term size.
-* TRIGGER_SEL_MAX selects single triggers of maximal term size.
-*
-* For example, consider the quantified formula :
-* forall xy. P( f( g( x, y ) ) ) V Q( f( x ), y )
-*
-* TRIGGER_SEL_MIN will select g( x, y ) and Q( f( x ), y ).
-* TRIGGER_SEL_MAX will select P( f( g( x ) ) ) and Q( f( x ), y ).
-*
-* The remaining three trigger selections make a difference for multi-triggers
-* only. For quantified formulas that require multi-triggers, we build a set of
-* partial triggers that don't contain all variables, call this set S. Then,
-* multi-triggers are built by taking a random subset of S that collectively
-* contains all variables.
-*
-* Consider the quantified formula :
-* forall xyz. P( h( x ), y ) V Q( y, z )
-*
-* For TRIGGER_SEL_ALL and TRIGGER_SEL_MIN_SINGLE_ALL,
-* S = { h( x ), P( h( x ), y ), Q( y, z ) }.
-* For TRIGGER_SEL_MIN_SINGLE_MAX,
-* S = { P( h( x ), y ), Q( y, z ) }.
-*
-* Furthermore, TRIGGER_SEL_MIN_SINGLE_ALL and TRIGGER_SEL_MIN_SINGLE_MAX, when
-* selecting single triggers, only select terms of minimal size.
-*/
-enum TriggerSelMode {
- /** only consider minimal terms for triggers */
- TRIGGER_SEL_MIN,
- /** only consider maximal terms for triggers */
- TRIGGER_SEL_MAX,
- /** consider minimal terms for single triggers, maximal for non-single */
- TRIGGER_SEL_MIN_SINGLE_MAX,
- /** consider minimal terms for single triggers, all for non-single */
- TRIGGER_SEL_MIN_SINGLE_ALL,
- /** consider all terms for triggers */
- TRIGGER_SEL_ALL,
-};
-
-enum TriggerActiveSelMode {
- /** always use all triggers */
- TRIGGER_ACTIVE_SEL_ALL,
- /** only use triggers with minimal # of ground terms */
- TRIGGER_ACTIVE_SEL_MIN,
- /** only use triggers with maximal # of ground terms */
- TRIGGER_ACTIVE_SEL_MAX,
-};
-
-enum CVC4_PUBLIC PrenexQuantMode {
- /** do not prenex */
- PRENEX_QUANT_NONE,
- /** prenex same sign quantifiers */
- PRENEX_QUANT_SIMPLE,
- /** aggressive prenex, disjunctive prenex normal form */
- PRENEX_QUANT_DISJ_NORMAL,
- /** prenex normal form */
- PRENEX_QUANT_NORMAL,
-};
-
-enum TermDbMode {
- /** consider all terms in master equality engine */
- TERM_DB_ALL,
- /** consider only relevant terms */
- TERM_DB_RELEVANT,
-};
-
-enum IteLiftQuantMode {
- /** do not lift ITEs in quantified formulas */
- ITE_LIFT_QUANT_MODE_NONE,
- /** only lift ITEs in quantified formulas if reduces the term size */
- ITE_LIFT_QUANT_MODE_SIMPLE,
- /** lift ITEs */
- ITE_LIFT_QUANT_MODE_ALL,
-};
-
-enum CbqiBvIneqMode
-{
- /** solve for inequalities using slack values in model */
- CBQI_BV_INEQ_EQ_SLACK,
- /** solve for inequalities using boundary points */
- CBQI_BV_INEQ_EQ_BOUNDARY,
- /** solve for inequalities directly, using side conditions */
- CBQI_BV_INEQ_KEEP,
-};
-
-enum CegqiSingleInvMode {
- /** do not use single invocation techniques */
- CEGQI_SI_MODE_NONE,
- /** use single invocation techniques */
- CEGQI_SI_MODE_USE,
- /** always use single invocation techniques */
- CEGQI_SI_MODE_ALL,
-};
-
-/** Solution reconstruction modes for single invocation conjectures
- *
- * These modes indicate the policy when CVC4 solves a synthesis conjecture using
- * single invocation techniques for a sygus problem with a user-specified
- * grammar.
- */
-enum CegqiSingleInvRconsMode
-{
- /**
- * Do not try to reconstruct solutions to single invocation conjectures. With
- * this mode, solutions produced by CVC4 may violate grammar restrictions.
- */
- CEGQI_SI_RCONS_MODE_NONE,
- /**
- * Try to reconstruct solution to single invocation conjectures in an
- * incomplete (fail fast) way.
- */
- CEGQI_SI_RCONS_MODE_TRY,
- /**
- * Reconstruct solutions to single invocation conjectures, but fail if we
- * reach an upper limit on number of iterations in the enumeration
- */
- CEGQI_SI_RCONS_MODE_ALL_LIMIT,
- /**
- * Reconstruct solutions to single invocation conjectures. This method
- * relies on an expensive enumeration technique which only terminates when
- * we succesfully reconstruct the solution, although it may not terminate.
- */
- CEGQI_SI_RCONS_MODE_ALL,
-};
-
-enum CegisSampleMode
-{
- /** do not use samples for CEGIS */
- CEGIS_SAMPLE_NONE,
- /** use samples for CEGIS */
- CEGIS_SAMPLE_USE,
- /** trust samples for CEGQI */
- CEGIS_SAMPLE_TRUST,
-};
-
-enum SygusInvTemplMode {
- /** synthesize I( x ) */
- SYGUS_INV_TEMPL_MODE_NONE,
- /** synthesize ( pre( x ) V I( x ) ) */
- SYGUS_INV_TEMPL_MODE_PRE,
- /** synthesize ( post( x ) ^ I( x ) ) */
- SYGUS_INV_TEMPL_MODE_POST,
-};
-
-enum SygusActiveGenMode
-{
- /** do not use actively-generated enumerators */
- SYGUS_ACTIVE_GEN_NONE,
- /** use basic enumeration for actively-generated enumerators */
- SYGUS_ACTIVE_GEN_ENUM_BASIC,
- /** use optimized enumeration actively-generated enumerators */
- SYGUS_ACTIVE_GEN_ENUM,
- /** use variable-agnostic enumerators */
- SYGUS_ACTIVE_GEN_VAR_AGNOSTIC,
- /** internally decide the best policy for each enumerator */
- SYGUS_ACTIVE_GEN_AUTO,
-};
-
-enum SygusQueryDumpFilesMode
-{
- /** do not dump query files */
- SYGUS_QUERY_DUMP_NONE,
- /** dump all query files */
- SYGUS_QUERY_DUMP_ALL,
- /** dump query files that were not solved by the subsolver */
- SYGUS_QUERY_DUMP_UNSOLVED,
-};
-
-enum SygusFilterSolMode
-{
- /** do not filter solutions */
- SYGUS_FILTER_SOL_NONE,
- /** filter logically stronger solutions */
- SYGUS_FILTER_SOL_STRONG,
- /** filter logically weaker solutions */
- SYGUS_FILTER_SOL_WEAK,
-};
-
-enum SygusGrammarConsMode
-{
- /**
- * Use simple default SyGuS grammar construction (no symbolic terms or
- * constants).
- */
- SYGUS_GCONS_SIMPLE,
- /** Use "any constant" constructors in default SyGuS grammar construction. */
- SYGUS_GCONS_ANY_CONST,
- /**
- * When applicable, use constructors that encode any term using "any constant"
- * constructors. This construction uses sum-of-monomials for arithmetic
- * grammars.
- */
- SYGUS_GCONS_ANY_TERM,
- /**
- * When applicable, use constructors that encode any term using "any constant"
- * constructors in a way that prefers conciseness over generality. This
- * construction uses polynomials for arithmetic grammars.
- */
- SYGUS_GCONS_ANY_TERM_CONCISE,
-};
-
-enum MacrosQuantMode {
- /** infer all definitions */
- MACROS_QUANT_MODE_ALL,
- /** infer ground definitions */
- MACROS_QUANT_MODE_GROUND,
- /** infer ground uf definitions */
- MACROS_QUANT_MODE_GROUND_UF,
-};
-
-enum QuantDSplitMode {
- /** never do quantifiers splitting */
- QUANT_DSPLIT_MODE_NONE,
- /** default */
- QUANT_DSPLIT_MODE_DEFAULT,
- /** do quantifiers splitting aggressively */
- QUANT_DSPLIT_MODE_AGG,
-};
-
-enum QuantRepMode {
- /** let equality engine choose representatives */
- QUANT_REP_MODE_EE,
- /** default, choose representatives that appear first */
- QUANT_REP_MODE_FIRST,
- /** choose representatives that have minimal depth */
- QUANT_REP_MODE_DEPTH,
-};
-
-/**
- * Modes for piecewise-independent unification for synthesis (see Barbosa et al
- * FMCAD 2019).
- */
-enum SygusUnifPiMode
-{
- /** do not do piecewise-independent unification for synthesis */
- SYGUS_UNIF_PI_NONE,
- /** use (finite-model) complete piecewise-independent unification */
- SYGUS_UNIF_PI_COMPLETE,
- /** use approach based on condition enumeration for piecewise-independent
- unification */
- SYGUS_UNIF_PI_CENUM,
- /** use approach based on condition enumeration with information gain
- heuristics for piecewise-independent unification */
- SYGUS_UNIF_PI_CENUM_IGAIN,
-};
-
-}/* CVC4::theory::quantifiers namespace */
-}/* CVC4::theory namespace */
-
-std::ostream& operator<<(std::ostream& out, theory::quantifiers::InstWhenMode mode) CVC4_PUBLIC;
-
-}/* CVC4 namespace */
-
-#endif /* CVC4__BASE__QUANTIFIERS_MODES_H */
name = "prenexQuant"
category = "regular"
long = "prenex-quant=MODE"
- type = "CVC4::theory::quantifiers::PrenexQuantMode"
- default = "CVC4::theory::quantifiers::PRENEX_QUANT_SIMPLE"
- handler = "stringToPrenexQuantMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "PrenexQuantMode"
+ default = "SIMPLE"
help = "prenex mode for quantified formulas"
+ help_mode = "Prenex quantifiers modes."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Do no prenex nested quantifiers."
+[[option.mode.SIMPLE]]
+ name = "simple"
+ help = "Do simple prenexing of same sign quantifiers."
+[[option.mode.DISJ_NORMAL]]
+ name = "dnorm"
+ help = "Prenex to disjunctive prenex normal form."
+[[option.mode.NORMAL]]
+ name = "norm"
+ help = "Prenex to prenex normal form."
[[option]]
name = "prenexQuantUser"
name = "iteLiftQuant"
category = "regular"
long = "ite-lift-quant=MODE"
- type = "CVC4::theory::quantifiers::IteLiftQuantMode"
- default = "CVC4::theory::quantifiers::ITE_LIFT_QUANT_MODE_SIMPLE"
- handler = "stringToIteLiftQuantMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "IteLiftQuantMode"
+ default = "SIMPLE"
help = "ite lifting mode for quantified formulas"
+ help_mode = "ITE lifting modes for quantified formulas."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Do not lift if-then-else in quantified formulas."
+[[option.mode.SIMPLE]]
+ name = "simple"
+ help = "Lift if-then-else in quantified formulas if results in smaller term size."
+[[option.mode.ALL]]
+ name = "all"
+ help = "Lift if-then-else in quantified formulas."
[[option]]
name = "condVarSplitQuant"
name = "termDbMode"
category = "regular"
long = "term-db-mode=MODE"
- type = "CVC4::theory::quantifiers::TermDbMode"
- default = "CVC4::theory::quantifiers::TERM_DB_ALL"
- handler = "stringToTermDbMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "TermDbMode"
+ default = "ALL"
help = "which ground terms to consider for instantiation"
+ help_mode = "Modes for terms included in the quantifiers term database."
+[[option.mode.ALL]]
+ name = "all"
+ help = "Quantifiers module considers all ground terms."
+[[option.mode.RELEVANT]]
+ name = "relevant"
+ help = "Quantifiers module considers only ground terms connected to current assertions."
[[option]]
name = "registerQuantBodyTerms"
read_only = true
help = "implementation of multi triggers where maximum number of instantiations is linear wrt number of ground terms"
+# Trigger selection mode.
+#
+# These modes are used for determining which terms to select
+# as triggers for quantified formulas, when necessary, during E-matching.
+# In the following, note the following terminology. A trigger is a set of terms,
+# where a single trigger is a singleton set and a multi-trigger is a set of more
+# than one term.
+#
+# MIN selects single triggers of minimal term size.
+# MAX selects single triggers of maximal term size.
+#
+# For example, consider the quantified formula :
+# forall xy. P( f( g( x, y ) ) ) V Q( f( x ), y )
+#
+# MIN will select g( x, y ) and Q( f( x ), y ).
+# MAX will select P( f( g( x ) ) ) and Q( f( x ), y ).
+#
+# The remaining three trigger selections make a difference for multi-triggers
+# only. For quantified formulas that require multi-triggers, we build a set of
+# partial triggers that don't contain all variables, call this set S. Then,
+# multi-triggers are built by taking a random subset of S that collectively
+# contains all variables.
+#
+# Consider the quantified formula :
+# forall xyz. P( h( x ), y ) V Q( y, z )
+#
+# For ALL and MIN_SINGLE_ALL,
+# S = { h( x ), P( h( x ), y ), Q( y, z ) }.
+# For MIN_SINGLE_MAX,
+# S = { P( h( x ), y ), Q( y, z ) }.
+#
+# Furthermore, MIN_SINGLE_ALL and MIN_SINGLE_MAX, when
+# selecting single triggers, only select terms of minimal size.
+#
[[option]]
name = "triggerSelMode"
category = "regular"
long = "trigger-sel=MODE"
- type = "CVC4::theory::quantifiers::TriggerSelMode"
- default = "CVC4::theory::quantifiers::TRIGGER_SEL_MIN"
- handler = "stringToTriggerSelMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "TriggerSelMode"
+ default = "MIN"
help = "selection mode for triggers"
+ help_mode = "Trigger selection modes."
+[[option.mode.MIN]]
+ name = "min"
+ help = "Consider only minimal subterms that meet criteria for triggers."
+[[option.mode.MAX]]
+ name = "max"
+ help = "Consider only maximal subterms that meet criteria for triggers."
+[[option.mode.MIN_SINGLE_MAX]]
+ name = "min-s-max"
+ help = "Consider only minimal subterms that meet criteria for single triggers, maximal otherwise."
+[[option.mode.MIN_SINGLE_ALL]]
+ name = "min-s-all"
+ help = "Consider only minimal subterms that meet criteria for single triggers, all otherwise."
+[[option.mode.ALL]]
+ name = "all"
+ help = "Consider all subterms that meet criteria for triggers."
[[option]]
name = "triggerActiveSelMode"
category = "regular"
long = "trigger-active-sel=MODE"
- type = "CVC4::theory::quantifiers::TriggerActiveSelMode"
- default = "CVC4::theory::quantifiers::TRIGGER_ACTIVE_SEL_ALL"
- handler = "stringToTriggerActiveSelMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "TriggerActiveSelMode"
+ default = "ALL"
help = "selection mode to activate triggers"
+ help_mode = "Trigger active selection modes."
+[[option.mode.ALL]]
+ name = "all"
+ help = "Make all triggers active."
+[[option.mode.MIN]]
+ name = "min"
+ help = "Activate triggers with minimal ground terms."
+[[option.mode.MAX]]
+ name = "max"
+ help = "Activate triggers with maximal ground terms."
[[option]]
name = "userPatternsQuant"
category = "regular"
long = "user-pat=MODE"
- type = "CVC4::theory::quantifiers::UserPatMode"
- default = "CVC4::theory::quantifiers::USER_PAT_MODE_TRUST"
- handler = "stringToUserPatMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "UserPatMode"
+ default = "TRUST"
help = "policy for handling user-provided patterns for quantifier instantiation"
+ help_mode = "These modes determine how user provided patterns (triggers) are used during E-matching. The modes vary on when instantiation based on user-provided triggers is combined with instantiation based on automatically selected triggers."
+[[option.mode.USE]]
+ name = "use"
+ help = "Use both user-provided and auto-generated patterns when patterns are provided for a quantified formula."
+[[option.mode.TRUST]]
+ name = "trust"
+ help = "When provided, use only user-provided patterns for a quantified formula."
+[[option.mode.RESORT]]
+ name = "resort"
+ help = "Use user-provided patterns only after auto-generated patterns saturate."
+[[option.mode.IGNORE]]
+ name = "ignore"
+ help = "Ignore user-provided patterns."
+[[option.mode.INTERLEAVE]]
+ name = "interleave"
+ help = "Alternate between use/resort."
[[option]]
name = "incrementTriggers"
name = "instWhenMode"
category = "regular"
long = "inst-when=MODE"
- type = "CVC4::theory::quantifiers::InstWhenMode"
- default = "CVC4::theory::quantifiers::INST_WHEN_FULL_LAST_CALL"
- handler = "stringToInstWhenMode"
+ type = "InstWhenMode"
+ default = "FULL_LAST_CALL"
predicates = ["checkInstWhenMode"]
- includes = ["options/quantifiers_modes.h"]
help = "when to apply instantiation"
+ help_mode = "Instantiation modes."
+[[option.mode.PRE_FULL]]
+ name = "pre-full"
+ help = "Run instantiation round before full effort (possibly at standard effort)."
+[[option.mode.FULL]]
+ name = "full"
+ help = "Run instantiation round at full effort, before theory combination."
+[[option.mode.FULL_DELAY]]
+ name = "full-delay"
+ help = "Run instantiation round at full effort, before theory combination, after all other theories have finished."
+[[option.mode.FULL_LAST_CALL]]
+ name = "full-last-call"
+ help = "Alternate running instantiation rounds at full effort and last call. In other words, interleave instantiation and theory combination."
+[[option.mode.FULL_DELAY_LAST_CALL]]
+ name = "full-delay-last-call"
+ help = "Alternate running instantiation rounds at full effort after all other theories have finished, and last call."
+[[option.mode.LAST_CALL]]
+ name = "last-call"
+ help = "Run instantiation at last call effort, after theory combination and and theories report sat."
[[option]]
name = "instWhenStrictInterleave"
name = "quantRepMode"
category = "regular"
long = "quant-rep-mode=MODE"
- type = "CVC4::theory::quantifiers::QuantRepMode"
- default = "CVC4::theory::quantifiers::QUANT_REP_MODE_FIRST"
- handler = "stringToQuantRepMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "QuantRepMode"
+ default = "FIRST"
help = "selection mode for representatives in quantifiers engine"
+ help_mode = "Modes for quantifiers representative selection."
+[[option.mode.EE]]
+ name = "ee"
+ help = "Let equality engine choose representatives."
+[[option.mode.FIRST]]
+ name = "first"
+ help = "Choose terms that appear first."
+[[option.mode.DEPTH]]
+ name = "depth"
+ help = "Choose terms that are of minimal depth."
[[option]]
name = "fullSaturateQuant"
name = "literalMatchMode"
category = "regular"
long = "literal-matching=MODE"
- type = "CVC4::theory::quantifiers::LiteralMatchMode"
- default = "CVC4::theory::quantifiers::LITERAL_MATCH_USE"
- handler = "stringToLiteralMatchMode"
- predicates = ["checkLiteralMatchMode"]
- includes = ["options/quantifiers_modes.h"]
+ type = "LiteralMatchMode"
+ default = "USE"
read_only = true
help = "choose literal matching mode"
+ help_mode = "Literal match modes."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Do not use literal matching."
+[[option.mode.USE]]
+ name = "use"
+ help = "Consider phase requirements of triggers conservatively. For example, the trigger P( x ) in forall( x ). ( P( x ) V ~Q( x ) ) will not be matched with terms in the equivalence class of true, and likewise Q( x ) will not be matched terms in the equivalence class of false. Extends to equality."
+[[option.mode.AGG_PREDICATE]]
+ name = "agg-predicate"
+ help = "Consider phase requirements aggressively for predicates. In the above example, only match P( x ) with terms that are in the equivalence class of false."
+[[option.mode.AGG]]
+ name = "agg"
+ help = "Consider the phase requirements aggressively for all triggers."
### Finite model finding options
name = "mbqiMode"
category = "regular"
long = "mbqi=MODE"
- type = "CVC4::theory::quantifiers::MbqiMode"
- default = "CVC4::theory::quantifiers::MBQI_FMC"
- handler = "stringToMbqiMode"
- predicates = ["checkMbqiMode"]
- includes = ["options/quantifiers_modes.h"]
+ type = "MbqiMode"
+ default = "FMC"
help = "choose mode for model-based quantifier instantiation"
+ help_mode = "Model-based quantifier instantiation modes."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Disable model-based quantifier instantiation."
+[[option.mode.FMC]]
+ name = "fmc"
+ help = "Use algorithm from Section 5.4.2 of thesis Finite Model Finding in Satisfiability Modulo Theories."
+[[option.mode.TRUST]]
+ name = "trust"
+ help = "Do not instantiate quantified formulas (incomplete technique)."
[[option]]
name = "fmfOneInstPerRound"
name = "qcfMode"
category = "regular"
long = "quant-cf-mode=MODE"
- type = "CVC4::theory::quantifiers::QcfMode"
- default = "CVC4::theory::quantifiers::QCF_PROP_EQ"
- handler = "stringToQcfMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "QcfMode"
+ default = "PROP_EQ"
read_only = true
help = "what effort to apply conflict find mechanism"
+ help_mode = "Quantifier conflict find modes."
+[[option.mode.CONFLICT_ONLY]]
+ name = "conflict"
+ help = "Apply QCF algorithm to find conflicts only."
+[[option.mode.PROP_EQ]]
+ name = "prop-eq"
+ help = "Apply QCF algorithm to propagate equalities as well as conflicts."
+[[option.mode.PARTIAL]]
+ name = "partial"
+ help = "Use QCF for conflicts, propagations and heuristic instantiations."
[[option]]
name = "qcfWhenMode"
category = "regular"
long = "quant-cf-when=MODE"
- type = "CVC4::theory::quantifiers::QcfWhenMode"
- default = "CVC4::theory::quantifiers::QCF_WHEN_MODE_DEFAULT"
- handler = "stringToQcfWhenMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "QcfWhenMode"
+ default = "DEFAULT"
read_only = true
help = "when to invoke conflict find mechanism for quantifiers"
+ help_mode = "Quantifier conflict find modes."
+[[option.mode.DEFAULT]]
+ name = "default"
+ help = "Default, apply conflict finding at full effort."
+[[option.mode.LAST_CALL]]
+ name = "last-call"
+ help = "Apply conflict finding at last call, after theory combination and and all theories report sat."
+[[option.mode.STD]]
+ name = "std"
+ help = "Apply conflict finding at standard effort."
+[[option.mode.STD_H]]
+ name = "std-h"
+ help = "Apply conflict finding at standard effort when heuristic says to."
[[option]]
name = "qcfTConstraint"
name = "cegqiSingleInvMode"
category = "regular"
long = "cegqi-si=MODE"
- type = "CVC4::theory::quantifiers::CegqiSingleInvMode"
- default = "CVC4::theory::quantifiers::CEGQI_SI_MODE_NONE"
- handler = "stringToCegqiSingleInvMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "CegqiSingleInvMode"
+ default = "NONE"
help = "mode for processing single invocation synthesis conjectures"
+ help_mode = "Modes for single invocation techniques."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Do not use single invocation techniques."
+[[option.mode.USE]]
+ name = "use"
+ help = "Use single invocation techniques only if grammar is not restrictive."
+[[option.mode.ALL]]
+ name = "all"
+ help = "Always use single invocation techniques."
[[option]]
name = "cegqiSingleInvPartial"
read_only = true
help = "combined techniques for synthesis conjectures that are partially single invocation"
+# Solution reconstruction modes for single invocation conjectures
+#
+# These modes indicate the policy when CVC4 solves a synthesis conjecture using
+# single invocation techniques for a sygus problem with a user-specified
+# grammar.
+#
[[option]]
name = "cegqiSingleInvReconstruct"
category = "regular"
long = "cegqi-si-rcons=MODE"
- type = "CVC4::theory::quantifiers::CegqiSingleInvRconsMode"
- default = "CVC4::theory::quantifiers::CEGQI_SI_RCONS_MODE_ALL_LIMIT"
- handler = "stringToCegqiSingleInvRconsMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "CegqiSingleInvRconsMode"
+ default = "ALL_LIMIT"
help = "policy for reconstructing solutions for single invocation conjectures"
+ help_mode = "Modes for reconstruction solutions while using single invocation techniques."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Do not try to reconstruct solutions in the original (user-provided) grammar when using single invocation techniques. In this mode, solutions produced by CVC4 may violate grammar restrictions."
+[[option.mode.TRY]]
+ name = "try"
+ help = "Try to reconstruct solutions in the original grammar when using single invocation techniques in an incomplete (fail-fast) manner."
+[[option.mode.ALL_LIMIT]]
+ name = "all-limit"
+ help = "Try to reconstruct solutions in the original grammar, but termintate if a maximum number of rounds for reconstruction is exceeded."
+[[option.mode.ALL]]
+ name = "all"
+ help = "Try to reconstruct solutions in the original grammar. In this mode, we do not terminate until a solution is successfully reconstructed."
[[option]]
name = "cegqiSingleInvReconstructLimit"
read_only = true
help = "abort if constant repair techniques are not applicable"
+# Modes for piecewise-independent unification for synthesis (see Barbosa et al
+# FMCAD 2019).
+#
[[option]]
name = "sygusUnifPi"
category = "regular"
long = "sygus-unif-pi=MODE"
- type = "CVC4::theory::quantifiers::SygusUnifPiMode"
- default = "CVC4::theory::quantifiers::SYGUS_UNIF_PI_NONE"
- handler = "stringToSygusUnifPiMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "SygusUnifPiMode"
+ default = "NONE"
read_only = true
help = "mode for synthesis via piecewise-indepedent unification"
+ help_mode = "Modes for piecewise-independent unification."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Do not use piecewise-independent unification."
+[[option.mode.COMPLETE]]
+ name = "complete"
+ help = "Use complete approach for piecewise-independent unification (see Section 3 of Barbosa et al FMCAD 2019)"
+[[option.mode.CENUM]]
+ name = "cond-enum"
+ help = "Use unconstrained condition enumeration for piecewise-independent unification (see Section 4 of Barbosa et al FMCAD 2019)."
+[[option.mode.CENUM_IGAIN]]
+ name = "cond-enum-igain"
+ help = "Same as cond-enum, but additionally uses an information gain heuristic when doing decision tree learning."
[[option]]
name = "sygusUnifShuffleCond"
name = "sygusActiveGenMode"
category = "regular"
long = "sygus-active-gen=MODE"
- type = "CVC4::theory::quantifiers::SygusActiveGenMode"
- default = "CVC4::theory::quantifiers::SYGUS_ACTIVE_GEN_AUTO"
- handler = "stringToSygusActiveGenMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "SygusActiveGenMode"
+ default = "AUTO"
read_only = true
help = "mode for actively-generated sygus enumerators"
+ help_mode = "Modes for actively-generated sygus enumerators."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Do not use actively-generated sygus enumerators."
+[[option.mode.ENUM_BASIC]]
+ name = "basic"
+ help = "Use basic type enumerator for actively-generated sygus enumerators."
+[[option.mode.ENUM]]
+ name = "enum"
+ help = "Use optimized enumerator for actively-generated sygus enumerators."
+[[option.mode.VAR_AGNOSTIC]]
+ name = "var-agnostic"
+ help = "Use sygus solver to enumerate terms that are agnostic to variables."
+[[option.mode.AUTO]]
+ name = "auto"
+ help = "Internally decide the best policy for each enumerator."
[[option]]
name = "sygusActiveGenEnumConsts"
name = "sygusGrammarConsMode"
category = "regular"
long = "sygus-grammar-cons=MODE"
- type = "CVC4::theory::quantifiers::SygusGrammarConsMode"
- default = "CVC4::theory::quantifiers::SYGUS_GCONS_SIMPLE"
- handler = "stringToSygusGrammarConsMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "SygusGrammarConsMode"
+ default = "SIMPLE"
help = "mode for SyGuS grammar construction"
+ help_mode = "Modes for default SyGuS grammars."
+[[option.mode.SIMPLE]]
+ name = "simple"
+ help = "Use simple grammar construction (no symbolic terms or constants)."
+[[option.mode.ANY_CONST]]
+ name = "any-const"
+ help = "Use symoblic constant constructors."
+[[option.mode.ANY_TERM]]
+ name = "any-term"
+ help = "When applicable, use constructors corresponding to any symbolic term. This option enables a sum-of-monomials grammar for arithmetic. For all other types, it enables symbolic constant constructors."
+[[option.mode.ANY_TERM_CONCISE]]
+ name = "any-term-concise"
+ help = "When applicable, use constructors corresponding to any symbolic term, favoring conciseness over generality. This option is equivalent to any-term but enables a polynomial grammar for arithmetic when not in a combined theory."
[[option]]
name = "sygusInvTemplMode"
category = "regular"
long = "sygus-inv-templ=MODE"
- type = "CVC4::theory::quantifiers::SygusInvTemplMode"
- default = "CVC4::theory::quantifiers::SYGUS_INV_TEMPL_MODE_POST"
- handler = "stringToSygusInvTemplMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "SygusInvTemplMode"
+ default = "POST"
help = "template mode for sygus invariant synthesis (weaken pre-condition, strengthen post-condition, or none)"
+ help_mode = "Template modes for sygus invariant synthesis."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Synthesize invariant directly."
+[[option.mode.PRE]]
+ name = "pre"
+ help = "Synthesize invariant based on weakening of precondition."
+[[option.mode.POST]]
+ name = "post"
+ help = "Synthesize invariant based on strengthening of postcondition."
[[option]]
name = "sygusInvTemplWhenSyntax"
name = "cegisSample"
category = "regular"
long = "cegis-sample=MODE"
- type = "CVC4::theory::quantifiers::CegisSampleMode"
- default = "CVC4::theory::quantifiers::CEGIS_SAMPLE_NONE"
- handler = "stringToCegisSampleMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "CegisSampleMode"
+ default = "NONE"
help = "mode for using samples in the counterexample-guided inductive synthesis loop"
+ help_mode = "Modes for sampling with counterexample-guided inductive synthesis (CEGIS)."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Do not use sampling with CEGIS."
+[[option.mode.USE]]
+ name = "use"
+ help = "Use sampling to accelerate CEGIS. This will rule out solutions for a conjecture when they are not satisfied by a sample point."
+[[option.mode.TRUST]]
+ name = "trust"
+ help = "Trust that when a solution for a conjecture is always true under sampling, then it is indeed a solution. Note this option may print out spurious solutions for synthesis conjectures."
[[option]]
name = "minSynthSol"
name = "sygusQueryGenDumpFiles"
category = "regular"
long = "sygus-query-gen-dump-files=MODE"
- type = "CVC4::theory::quantifiers::SygusQueryDumpFilesMode"
- default = "CVC4::theory::quantifiers::SYGUS_QUERY_DUMP_NONE"
- handler = "stringToSygusQueryDumpFilesMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "SygusQueryDumpFilesMode"
+ default = "NONE"
help = "mode for dumping external files corresponding to interesting satisfiability queries with sygus-query-gen"
+ help_mode = "Query file options."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Do not dump query files when using --sygus-query-gen."
+[[option.mode.ALL]]
+ name = "all"
+ help = "Dump all query files."
+[[option.mode.UNSOLVED]]
+ name = "unsolved"
+ help = "Dump query files that the subsolver did not solve."
[[option]]
name = "sygusFilterSolMode"
category = "regular"
long = "sygus-filter-sol=MODE"
- type = "CVC4::theory::quantifiers::SygusFilterSolMode"
- default = "CVC4::theory::quantifiers::SYGUS_FILTER_SOL_NONE"
- handler = "stringToSygusFilterSolMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "SygusFilterSolMode"
+ default = "NONE"
help = "mode for filtering sygus solutions"
+ help_mode = "Modes for filtering sygus solutions."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Do not filter sygus solutions."
+[[option.mode.STRONG]]
+ name = "strong"
+ help = "Filter solutions that are logically stronger than others."
+[[option.mode.WEAK]]
+ name = "weak"
+ help = "Filter solutions that are logically weaker than others."
[[option]]
name = "sygusFilterSolRevSubsume"
name = "cbqiBvIneqMode"
category = "regular"
long = "cbqi-bv-ineq=MODE"
- type = "CVC4::theory::quantifiers::CbqiBvIneqMode"
- default = "CVC4::theory::quantifiers::CBQI_BV_INEQ_EQ_BOUNDARY"
- handler = "stringToCbqiBvIneqMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "CbqiBvIneqMode"
+ default = "EQ_BOUNDARY"
help = "choose mode for handling bit-vector inequalities with counterexample-guided instantiation"
+ help_mode = "Modes for handling bit-vector inequalities in counterexample-guided instantiation."
+[[option.mode.EQ_SLACK]]
+ name = "eq-slack"
+ help = "Solve for the inequality using the slack value in the model, e.g., t > s becomes t = s + ( t-s )^M."
+[[option.mode.EQ_BOUNDARY]]
+ name = "eq-boundary"
+ help = "Solve for the boundary point of the inequality, e.g., t > s becomes t = s+1."
+[[option.mode.KEEP]]
+ name = "keep"
+ help = "Solve for the inequality directly using side conditions for invertibility."
[[option]]
name = "cbqiBvRmExtract"
name = "macrosQuantMode"
category = "regular"
long = "macros-quant-mode=MODE"
- type = "CVC4::theory::quantifiers::MacrosQuantMode"
- default = "CVC4::theory::quantifiers::MACROS_QUANT_MODE_GROUND_UF"
- handler = "stringToMacrosQuantMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "MacrosQuantMode"
+ default = "GROUND_UF"
read_only = true
help = "mode for quantifiers macro expansion"
+ help_mode = "Modes for quantifiers macro expansion."
+[[option.mode.ALL]]
+ name = "all"
+ help = "Infer definitions for functions, including those containing quantified formulas."
+[[option.mode.GROUND]]
+ name = "ground"
+ help = "Only infer ground definitions for functions."
+[[option.mode.GROUND_UF]]
+ name = "ground-uf"
+ help = "Only infer ground definitions for functions that result in triggers for all free variables."
[[option]]
name = "quantDynamicSplit"
category = "regular"
long = "quant-dsplit-mode=MODE"
- type = "CVC4::theory::quantifiers::QuantDSplitMode"
- default = "CVC4::theory::quantifiers::QUANT_DSPLIT_MODE_DEFAULT"
- handler = "stringToQuantDSplitMode"
- includes = ["options/quantifiers_modes.h"]
+ type = "QuantDSplitMode"
+ default = "DEFAULT"
help = "mode for dynamic quantifiers splitting"
+ help_mode = "Modes for quantifiers splitting."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Never split quantified formulas."
+[[option.mode.DEFAULT]]
+ name = "default"
+ help = "Split quantified formulas over some finite datatypes when finite model finding is enabled."
+[[option.mode.AGG]]
+ name = "agg"
+ help = "Aggressively split quantified formulas."
[[option]]
name = "quantAntiSkolem"
+++ /dev/null
-/********************* */
-/*! \file smt_modes.cpp
- ** \verbatim
- ** Top contributors (to current version):
- ** Andrew Reynolds, Morgan Deters
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief [[ Add one-line brief description here ]]
- **
- ** [[ Add lengthier description here ]]
- ** \todo document this file
- **/
-
-#include "options/smt_modes.h"
-
-#include <iostream>
-
-namespace CVC4 {
-
-std::ostream& operator<<(std::ostream& out, SimplificationMode mode)
-{
- switch (mode)
- {
- case SIMPLIFICATION_MODE_BATCH: out << "SIMPLIFICATION_MODE_BATCH"; break;
- case SIMPLIFICATION_MODE_NONE: out << "SIMPLIFICATION_MODE_NONE"; break;
- default: out << "SimplificationMode:UNKNOWN![" << unsigned(mode) << "]";
- }
-
- return out;
-}
-
-} // namespace CVC4
+++ /dev/null
-/********************* */
-/*! \file smt_modes.h
- ** \verbatim
- ** Top contributors (to current version):
- ** Andrew Reynolds, Morgan Deters, Dejan Jovanovic
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief [[ Add one-line brief description here ]]
- **
- ** [[ Add lengthier description here ]]
- ** \todo document this file
- **/
-
-#include "cvc4_public.h"
-
-#ifndef CVC4__SMT__MODES_H
-#define CVC4__SMT__MODES_H
-
-#include <iosfwd>
-
-namespace CVC4 {
-
-/** Enumeration of simplification modes (when to simplify). */
-enum SimplificationMode
-{
- /** Simplify the assertions all together once a check is requested */
- SIMPLIFICATION_MODE_BATCH,
- /** Don't do simplification */
- SIMPLIFICATION_MODE_NONE
-};
-
-std::ostream& operator<<(std::ostream& out,
- SimplificationMode mode) CVC4_PUBLIC;
-
-/** Enumeration of model core modes. */
-enum ModelCoresMode
-{
- /** Do not compute model cores */
- MODEL_CORES_NONE,
- /**
- * Compute "simple" model cores that exclude variables that do not
- * contribute to satisfying the input.
- */
- MODEL_CORES_SIMPLE,
- /**
- * Compute model cores that also exclude variables whose variables are implied
- * by others.
- */
- MODEL_CORES_NON_IMPLIED
-};
-
-/** Block models modes. */
-enum BlockModelsMode
-{
- /** Do not block models */
- BLOCK_MODELS_NONE,
- /**
- * block models based on literals truth values.
- */
- BLOCK_MODELS_LITERALS,
- /**
- * block models based on concrete variable values in the model.
- */
- BLOCK_MODELS_VALUES,
-};
-
-} // namespace CVC4
-
-#endif /* CVC4__SMT__MODES_H */
category = "regular"
long = "simplification=MODE"
type = "SimplificationMode"
- default = "SIMPLIFICATION_MODE_BATCH"
- handler = "stringToSimplificationMode"
- includes = ["options/smt_modes.h"]
+ default = "BATCH"
help = "choose simplification mode, see --simplification=help"
+ help_mode = "Simplification modes."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Do not perform nonclausal simplification."
+[[option.mode.BATCH]]
+ name = "batch"
+ help = "Save up all ASSERTions; run nonclausal simplification and clausal (MiniSat) propagation for all of them only after reaching a querying command (CHECKSAT or QUERY or predicate SUBTYPE declaration)."
[[alias]]
category = "regular"
category = "regular"
long = "model-cores=MODE"
type = "ModelCoresMode"
- default = "MODEL_CORES_NONE"
- handler = "stringToModelCoresMode"
- includes = ["options/smt_modes.h"]
+ default = "NONE"
help = "mode for producing model cores"
-
+ help_mode = "Model cores modes."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Do not compute model cores."
+[[option.mode.SIMPLE]]
+ name = "simple"
+ help = "Only include a subset of variables whose values are sufficient to show the input formula is satisfied by the given model."
+[[option.mode.NON_IMPLIED]]
+ name = "non-implied"
+ help = "Only include a subset of variables whose values, in addition to the values of variables whose values are implied, are sufficient to show the input formula is satisfied by the given model."
[[option]]
name = "blockModelsMode"
category = "regular"
long = "block-models=MODE"
type = "BlockModelsMode"
- default = "BLOCK_MODELS_NONE"
- handler = "stringToBlockModelsMode"
- includes = ["options/smt_modes.h"]
+ default = "NONE"
help = "mode for producing several models"
+ help_mode = "Blocking models modes."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Do not block models."
+[[option.mode.LITERALS]]
+ name = "literals"
+ help = "Block models based on the SAT skeleton."
+[[option.mode.VALUES]]
+ name = "valuels"
+ help = "Block models based on the concrete model values for the free variables."
[[option]]
name = "proof"
category = "regular"
long = "sygus-out=MODE"
type = "SygusSolutionOutMode"
- default = "SYGUS_SOL_OUT_STATUS_AND_DEF"
- handler = "stringToSygusSolutionOutMode"
- includes = ["options/sygus_out_mode.h"]
+ default = "STATUS_AND_DEF"
help = "output mode for sygus"
+ help_mode = "Modes for sygus solution output."
+[[option.mode.STATUS]]
+ name = "status"
+ help = "Print only status for check-synth calls."
+[[option.mode.STATUS_AND_DEF]]
+ name = "status-and-def"
+ help = "Print status followed by definition corresponding to solution."
+[[option.mode.STATUS_OR_DEF]]
+ name = "status-or-def"
+ help = "Print status if infeasible, or definition corresponding to solution if feasible."
+[[option.mode.STANDARD]]
+ name = "sygus-standard"
+ help = "Print based on SyGuS standard."
[[option]]
name = "sygusPrintCallbacks"
+++ /dev/null
-/********************* */
-/*! \file strings_modes.cpp
- ** \verbatim
- ** Top contributors (to current version):
- ** Andres Noetzli
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief Modes for the string solver.
- **/
-
-#include "options/strings_modes.h"
-
-#include <cstdint>
-#include <iostream>
-
-namespace CVC4 {
-
-std::ostream& operator<<(std::ostream& out,
- theory::strings::ProcessLoopMode mode)
-{
- switch (mode)
- {
- case theory::strings::ProcessLoopMode::FULL:
- out << "ProcessLoopMode::FULL";
- break;
- case theory::strings::ProcessLoopMode::SIMPLE:
- out << "ProcessLoopMode::SIMPLE";
- break;
- case theory::strings::ProcessLoopMode::SIMPLE_ABORT:
- out << "ProcessLoopMode::SIMPLE_ABORT";
- break;
- case theory::strings::ProcessLoopMode::NONE:
- out << "ProcessLoopMode::NONE";
- break;
- case theory::strings::ProcessLoopMode::ABORT:
- out << "ProcessLoopMode::ABORT";
- break;
- default:
- out << "ProcessLoopMode:UNKNOWN![" << static_cast<int64_t>(mode) << "]";
- }
- return out;
-}
-
-std::ostream& operator<<(std::ostream& out,
- theory::strings::RegExpInterMode mode)
-{
- switch (mode)
- {
- case theory::strings::RegExpInterMode::RE_INTER_ALL:
- out << "RegExpInterMode::RE_INTER_ALL";
- break;
- case theory::strings::RegExpInterMode::RE_INTER_CONSTANT:
- out << "RegExpInterMode::RE_INTER_CONSTANT";
- break;
- case theory::strings::RegExpInterMode::RE_INTER_ONE_CONSTANT:
- out << "RegExpInterMode::RE_INTER_ONE_CONSTANT";
- break;
- case theory::strings::RegExpInterMode::RE_INTER_NONE:
- out << "RegExpInterMode::RE_INTER_NONE";
- break;
- default:
- out << "RegExpInterMode:UNKNOWN![" << static_cast<int64_t>(mode) << "]";
- }
- return out;
-}
-
-} // namespace CVC4
+++ /dev/null
-/********************* */
-/*! \file strings_modes.h
- ** \verbatim
- ** Top contributors (to current version):
- ** Andres Noetzli
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief Modes for the string solver.
- **/
-
-#include "cvc4_private.h"
-
-#ifndef CVC4__THEORY__STRINGS__STRINGS_MODES_H
-#define CVC4__THEORY__STRINGS__STRINGS_MODES_H
-
-#include <iosfwd>
-
-namespace CVC4 {
-namespace theory {
-namespace strings {
-
-/** Enumeration of string processing loop modes */
-enum ProcessLoopMode
-{
- /** Perform full loop processing. */
- FULL,
-
- /** Omit normal loop breaking. */
- SIMPLE,
-
- /** Abort if normal loop breaking is required. */
- SIMPLE_ABORT,
-
- /** Omit loop processing. */
- NONE,
-
- /** Abort if looping word equations are encountered. */
- ABORT
-}; // enum ProcessLoopMode
-
-/** Enumeration of regular expression intersection modes */
-enum RegExpInterMode
-{
- /** Compute intersections for all regular expressions. */
- RE_INTER_ALL,
-
- /**
- * Compute intersections only for regular expressions without re.allchar
- * and re.range.
- */
- RE_INTER_CONSTANT,
-
- /**
- * Compute intersections only between regular expressions where one side does
- * not contain re.allchar and re.range.
- */
- RE_INTER_ONE_CONSTANT,
-
- /** Do not compute intersections of regular expressions. */
- RE_INTER_NONE,
-}; // enum RegExpInterMode
-
-} // namespace strings
-} // namespace theory
-
-std::ostream& operator<<(std::ostream& out,
- theory::strings::ProcessLoopMode mode);
-
-std::ostream& operator<<(std::ostream& out,
- theory::strings::RegExpInterMode mode);
-
-} // namespace CVC4
-
-#endif /* CVC4__THEORY__STRINGS__STRINGS_MODES_H */
name = "stringProcessLoopMode"
category = "expert"
long = "strings-process-loop-mode=MODE"
- type = "CVC4::theory::strings::ProcessLoopMode"
- default = "CVC4::theory::strings::ProcessLoopMode::FULL"
- handler = "stringToStringsProcessLoopMode"
- includes = ["options/strings_modes.h"]
+ type = "ProcessLoopMode"
+ default = "FULL"
help = "determines how to process looping string equations"
+ help_mode = "Loop processing modes."
+[[option.mode.FULL]]
+ name = "full"
+ help = "Perform full processing of looping word equations."
+[[option.mode.SIMPLE]]
+ name = "simple"
+ help = "Omit normal loop breaking (default with --strings-fmf)."
+[[option.mode.SIMPLE_ABORT]]
+ name = "simple-abort"
+ help = "Abort when normal loop breaking is required."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Omit loop processing."
+[[option.mode.ABORT]]
+ name = "abort"
+ help = "Abort if looping word equations are encountered."
+
[[option]]
name = "stringInferAsLemmas"
name = "stringRegExpInterMode"
category = "expert"
long = "re-inter-mode=MODE"
- type = "CVC4::theory::strings::RegExpInterMode"
- default = "CVC4::theory::strings::RE_INTER_CONSTANT"
- handler = "stringToRegExpInterMode"
- includes = ["options/strings_modes.h"]
+ type = "RegExpInterMode"
+ default = "CONSTANT"
help = "determines which regular expressions intersections to compute"
+ help_mode = "Regular expression intersection modes."
+[[option.mode.ALL]]
+ name = "all"
+ help = "Compute intersections for all regular expressions."
+[[option.mode.CONSTANT]]
+ name = "constant"
+ help = "Compute intersections only between regular expressions that do not contain re.allchar or re.range."
+[[option.mode.ONE_CONSTANT]]
+ name = "one-constant"
+ help = "Compute intersections only between regular expressions such that at least one side does not contain re.allchar or re.range."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Do not compute intersections for regular expressions."
+++ /dev/null
-/********************* */
-/*! \file sygus_out_mode.h
- ** \verbatim
- ** Top contributors (to current version):
- ** Andrew Reynolds
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief Options for sygus solution output.
- **/
-
-#include "cvc4_public.h"
-
-#ifndef CVC4__SMT__SYGUS_OUT_MODE_H
-#define CVC4__SMT__SYGUS_OUT_MODE_H
-
-#include <iosfwd>
-
-namespace CVC4 {
-
-/** Mode for printing sygus solutions. */
-enum SygusSolutionOutMode
-{
- /** print status */
- SYGUS_SOL_OUT_STATUS,
- /** (default) print status and solution */
- SYGUS_SOL_OUT_STATUS_AND_DEF,
- /** print status if infeasible, or solution if feasible */
- SYGUS_SOL_OUT_STATUS_OR_DEF,
- /** print output specified by sygus standard */
- SYGUS_SOL_OUT_STANDARD,
-};
-
-} /* CVC4 namespace */
-
-#endif /* CVC4__SMT__SYGUS_OUT_MODE_H */
smt_name = "theoryof-mode"
category = "expert"
long = "theoryof-mode=MODE"
- type = "CVC4::theory::TheoryOfMode"
- default = "CVC4::theory::THEORY_OF_TYPE_BASED"
- handler = "stringToTheoryOfMode"
- includes = ["options/theoryof_mode.h"]
+ type = "TheoryOfMode"
+ default = "THEORY_OF_TYPE_BASED"
help = "mode for Theory::theoryof()"
+ help_mode = "Defines how we associate theories with terms."
+[[option.mode.THEORY_OF_TYPE_BASED]]
+ name = "type"
+ help = "Type variables, constants and equalities by type."
+[[option.mode.THEORY_OF_TERM_BASED]]
+ name = "term"
+ help = "Type variables as uninterpreted, type constants by theory, equalities by the parametric theory."
[[option]]
name = "useTheoryList"
+++ /dev/null
-/********************* */
-/*! \file theoryof_mode.cpp
- ** \verbatim
- ** Top contributors (to current version):
- ** Morgan Deters, Tim King
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief [[ Add one-line brief description here ]]
- **
- ** [[ Add lengthier description here ]]
- ** \todo document this file
- **/
-
-
-#include "options/theoryof_mode.h"
-
-#include <ostream>
-
-namespace CVC4 {
-namespace theory {
-
-std::ostream& operator<<(std::ostream& out, TheoryOfMode m)
-{
- switch(m) {
- case THEORY_OF_TYPE_BASED: return out << "THEORY_OF_TYPE_BASED";
- case THEORY_OF_TERM_BASED: return out << "THEORY_OF_TERM_BASED";
- default: return out << "TheoryOfMode!UNKNOWN";
- }
-}
-
-}/* CVC4::theory namespace */
-}/* CVC4 namespace */
+++ /dev/null
-/********************* */
-/*! \file theoryof_mode.h
- ** \verbatim
- ** Top contributors (to current version):
- ** Dejan Jovanovic, Morgan Deters, Tim King
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief Option selection for theoryOf() operation
- **
- ** Option selection for theoryOf() operation.
- **/
-
-#include "cvc4_public.h"
-
-#pragma once
-
-#include <ostream>
-
-namespace CVC4 {
-namespace theory {
-
-/** How do we associate theories with the terms */
-enum TheoryOfMode {
- /** Equality, variables and constants are associated with the types */
- THEORY_OF_TYPE_BASED,
- /** Variables are uninterpreted, constants are with the type, equalities prefer parametric */
- THEORY_OF_TERM_BASED
-};/* enum TheoryOfMode */
-
-std::ostream& operator<<(std::ostream& out, TheoryOfMode m) CVC4_PUBLIC;
-
-}/* CVC4::theory namespace */
-}/* CVC4 namespace */
-
name = "ufssMode"
category = "regular"
long = "uf-ss=MODE"
- type = "CVC4::theory::uf::UfssMode"
- default = "CVC4::theory::uf::UF_SS_FULL"
- handler = "stringToUfssMode"
- includes = ["options/ufss_mode.h"]
+ type = "UfssMode"
+ default = "FULL"
read_only = true
help = "mode of operation for uf with cardinality solver."
+ help_mode = "UF with cardinality options currently supported by the --uf-ss option when combined with finite model finding."
+[[option.mode.FULL]]
+ name = "full"
+ help = "Default, use UF with cardinality to find minimal models for uninterpreted sorts."
+[[option.mode.NO_MINIMAL]]
+ name = "no-minimal"
+ help = "Use UF with cardinality to shrink models, but do no enforce minimality."
+[[option.mode.NONE]]
+ name = "none"
+ help = "Do not use UF with cardinality to shrink model sizes."
[[option]]
name = "ufssFairness"
+++ /dev/null
-/********************* */
-/*! \file ufss_mode.h
- ** \verbatim
- ** Top contributors (to current version):
- ** Andrew Reynolds, Tim King
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief Custom handlers and predicates for TheoryUF options
- **
- ** Custom handlers and predicates for TheoryUF options.
- **/
-
-#include "cvc4_private.h"
-
-#ifndef CVC4__BASE__UFSS_MODE_H
-#define CVC4__BASE__UFSS_MODE_H
-
-namespace CVC4 {
-namespace theory {
-namespace uf {
-
-/**
- * These modes determine the role of UF with cardinality when using finite model
- * finding (--finite-model-find).
- */
-enum UfssMode
-{
- /**
- * Default, use UF with cardinality to find minimal models for uninterpreted
- * sorts.
- */
- UF_SS_FULL,
- /**
- * Use UF with cardinality to shrink model sizes, but do no enforce
- * minimality.
- */
- UF_SS_NO_MINIMAL,
- /** do not use UF with cardinality */
- UF_SS_NONE,
-};
-
-}/* CVC4::theory::uf namespace */
-}/* CVC4::theory namespace */
-}/* CVC4 namespace */
-
-#endif /* CVC4__BASE__UFSS_MODE_H */
Node BoolToBV::lowerAssertion(const TNode& a)
{
- bool optionITE = options::boolToBitvector() == BOOL_TO_BV_ITE;
+ bool optionITE = options::boolToBitvector() == options::BoolToBVMode::ITE;
NodeManager* nm = NodeManager::currentNM();
std::vector<TNode> visit;
visit.push_back(a);
if (!all_bv || (n.getNumChildren() == 0))
{
- if ((options::boolToBitvector() == BOOL_TO_BV_ALL)
+ if ((options::boolToBitvector() == options::BoolToBVMode::ALL)
&& n.getType().isBoolean())
{
if (k == kind::CONST_BOOLEAN)
}
NodeBuilder<> builder(new_kind);
- if ((options::boolToBitvector() == BOOL_TO_BV_ALL) && (new_kind != k))
+ if ((options::boolToBitvector() == options::BoolToBVMode::ALL)
+ && (new_kind != k))
{
++(d_statistics.d_numTermsLowered);
}
"preprocessing::passes::BoolToBV::NumTermsForcedLowered", 0)
{
smtStatisticsRegistry()->registerStat(&d_numIteToBvite);
- if (options::boolToBitvector() == BOOL_TO_BV_ALL)
+ if (options::boolToBitvector() == options::BoolToBVMode::ALL)
{
// these statistics wouldn't be correct in the ITE mode,
// because it might discard rebuilt nodes if it fails to
BoolToBV::Statistics::~Statistics()
{
smtStatisticsRegistry()->unregisterStat(&d_numIteToBvite);
- if (options::boolToBitvector() == BOOL_TO_BV_ALL)
+ if (options::boolToBitvector() == options::BoolToBVMode::ALL)
{
smtStatisticsRegistry()->unregisterStat(&d_numTermsLowered);
smtStatisticsRegistry()->unregisterStat(&d_numTermsForcedLowered);
}
// If we are using the lazy solver and the abstraction applies, then UF
// symbols were introduced.
- if (options::bitblastMode() == bv::BITBLAST_MODE_LAZY && changed)
+ if (options::bitblastMode() == options::BitblastMode::LAZY && changed)
{
d_preprocContext->widenLogic(theory::THEORY_UF);
}
#include <vector>
-#include "options/quantifiers_modes.h"
#include "options/quantifiers_options.h"
#include "proof/proof_manager.h"
#include "smt/smt_engine.h"
}
bool QuantifierMacros::simplify( std::vector< Node >& assertions, bool doRewrite ){
- unsigned rmax = options::macrosQuantMode()==MACROS_QUANT_MODE_ALL ? 2 : 1;
+ unsigned rmax =
+ options::macrosQuantMode() == options::MacrosQuantMode::ALL ? 2 : 1;
for( unsigned r=0; r<rmax; r++ ){
d_ground_macros = (r==0);
Trace("macros") << "Find macros, ground=" << d_ground_macros << "..." << std::endl;
if( !containsBadOp( n_def, op, opc, visited ) ){
Trace("macros-debug") << "...does not contain bad (recursive) operator." << std::endl;
//must be ground UF term if mode is GROUND_UF
- if( options::macrosQuantMode()!=MACROS_QUANT_MODE_GROUND_UF || isGroundUfTerm( f, n_def ) ){
+ if (options::macrosQuantMode()
+ != options::MacrosQuantMode::GROUND_UF
+ || isGroundUfTerm(f, n_def))
+ {
Trace("macros-debug") << "...respects ground-uf constraint." << std::endl;
//now we must rewrite candidates[i] to a term of form g( x1, ..., xn ) where
// x1 ... xn are distinct variables
void BitVectorProof::printEmptyClauseProof(std::ostream& os,
std::ostream& paren)
{
- Assert(options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER)
+ Assert(options::bitblastMode() == options::BitblastMode::EAGER)
<< "the BV theory should only be proving bottom directly in the eager "
"bitblasting mode";
}
std::vector<Expr>::const_iterator it = d_bbTerms.begin();
std::vector<Expr>::const_iterator end = d_bbTerms.end();
for (; it != end; ++it) {
- if (d_usedBB.find(*it) == d_usedBB.end() &&
- options::bitblastMode() != theory::bv::BITBLAST_MODE_EAGER)
+ if (d_usedBB.find(*it) == d_usedBB.end()
+ && options::bitblastMode() != options::BitblastMode::EAGER)
continue;
// Is this term has an alias, we inject it through the decl_bblast statement
ExprToExpr::const_iterator ait = d_bbAtoms.begin();
ExprToExpr::const_iterator aend = d_bbAtoms.end();
for (; ait != aend; ++ait) {
- if (d_usedBB.find(ait->first) == d_usedBB.end() &&
- options::bitblastMode() != theory::bv::BITBLAST_MODE_EAGER)
+ if (d_usedBB.find(ait->first) == d_usedBB.end()
+ && options::bitblastMode() != options::BitblastMode::EAGER)
continue;
os << "(th_let_pf _ ";
{
TimerStat::CodeTimer optimizeDratProofTimer{
d_dratOptimizationStatistics.d_totalTime};
- if (options::bvOptimizeSatProof()
- == theory::bv::BvOptimizeSatProof::BITVECTOR_OPTIMIZE_SAT_PROOF_PROOF
- || options::bvOptimizeSatProof()
- == theory::bv::BvOptimizeSatProof::
- BITVECTOR_OPTIMIZE_SAT_PROOF_FORMULA)
+ if (options::bvOptimizeSatProof() == options::BvOptimizeSatProof::PROOF
+ || options::bvOptimizeSatProof() == options::BvOptimizeSatProof::FORMULA)
{
Debug("bv::clausal") << "Optimizing DRAT" << std::endl;
std::string formulaFilename("cvc4-dimacs-XXXXXX");
static_cast<int64_t>(d_binaryDratProof.tellp()) - startPos);
}
- if (options::bvOptimizeSatProof()
- == theory::bv::BvOptimizeSatProof::BITVECTOR_OPTIMIZE_SAT_PROOF_FORMULA)
+ if (options::bvOptimizeSatProof() == options::BvOptimizeSatProof::FORMULA)
{
std::ifstream optFormulaStream{optFormulaFilename};
const int64_t startPos = static_cast<int64_t>(optFormulaStream.tellg());
void LfscDratBitVectorProof::printEmptyClauseProof(std::ostream& os,
std::ostream& paren)
{
- Assert(options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER)
+ Assert(options::bitblastMode() == options::BitblastMode::EAGER)
<< "the BV theory should only be proving bottom directly in the eager "
"bitblasting mode";
void LfscLratBitVectorProof::printEmptyClauseProof(std::ostream& os,
std::ostream& paren)
{
- Assert(options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER)
+ Assert(options::bitblastMode() == options::BitblastMode::EAGER)
<< "the BV theory should only be proving bottom directly in the eager "
"bitblasting mode";
void LfscErBitVectorProof::printEmptyClauseProof(std::ostream& os,
std::ostream& paren)
{
- Assert(options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER)
+ Assert(options::bitblastMode() == options::BitblastMode::EAGER)
<< "the BV theory should only be proving bottom directly in the eager "
"bitblasting mode";
CodeTimer finalProofTimer{
ProofManager::currentPM()->getStats().d_finalProofTime};
out << ";; Printing final unsat proof \n";
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER
+ if (options::bitblastMode() == options::BitblastMode::EAGER
&& ProofManager::getBitVectorProof())
{
ProofManager::getBitVectorProof()->printEmptyClauseProof(out, paren);
void ResolutionBitVectorProof::finalizeConflicts(std::vector<Expr>& conflicts)
{
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER)
+ if (options::bitblastMode() == options::BitblastMode::EAGER)
{
Debug("pf::bv") << "Construct full proof." << std::endl;
d_resolutionProof->constructProof();
void LfscResolutionBitVectorProof::printEmptyClauseProof(std::ostream& os,
std::ostream& paren)
{
- Assert(options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER)
+ Assert(options::bitblastMode() == options::BitblastMode::EAGER)
<< "the BV theory should only be proving bottom directly in the eager "
"bitblasting mode";
proof::LFSCProofPrinter::printResolutionEmptyClause(
if (id == theory::THEORY_BV) {
auto thBv = static_cast<theory::bv::TheoryBV*>(th);
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER
- && options::bvSatSolver() == theory::bv::SAT_SOLVER_CRYPTOMINISAT)
+ if (options::bitblastMode() == options::BitblastMode::EAGER
+ && options::bvSatSolver() == options::SatSolverMode::CRYPTOMINISAT)
{
proof::BitVectorProof* bvp = nullptr;
switch (options::bvProofFormat())
{
- case theory::bv::BvProofFormat::BITVECTOR_PROOF_DRAT:
+ case options::BvProofFormat::DRAT:
{
bvp = new proof::LfscDratBitVectorProof(thBv, this);
break;
}
- case theory::bv::BvProofFormat::BITVECTOR_PROOF_LRAT:
+ case options::BvProofFormat::LRAT:
{
bvp = new proof::LfscLratBitVectorProof(thBv, this);
break;
}
- case theory::bv::BvProofFormat::BITVECTOR_PROOF_ER:
+ case options::BvProofFormat::ER:
{
bvp = new proof::LfscErBitVectorProof(thBv, this);
break;
// finalizeBvConflicts(lemmas, os, paren, map);
ProofManager::getBitVectorProof()->printBBDeclarationAndCnf(os, paren, map);
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER) {
+ if (options::bitblastMode() == options::BitblastMode::EAGER)
+ {
Assert(lemmas.size() == 1);
// nothing more to do (no combination with eager so far)
return;
//=================================================================================================
// Constructor/Destructor:
-
-SimpSolver::SimpSolver(CVC4::context::Context* c) :
- Solver(c)
- , grow (opt_grow)
- , clause_lim (opt_clause_lim)
- , subsumption_lim (opt_subsumption_lim)
- , simp_garbage_frac (opt_simp_garbage_frac)
- , use_asymm (opt_use_asymm)
- , use_rcheck (opt_use_rcheck)
- , use_elim (opt_use_elim &&
- CVC4::options::bitblastMode() == CVC4::theory::bv::BITBLAST_MODE_EAGER &&
- !CVC4::options::produceModels())
- , merges (0)
- , asymm_lits (0)
- , eliminated_vars (0)
- , elimorder (1)
- , use_simplification (!PROOF_ON())
- , occurs (ClauseDeleted(ca))
- , elim_heap (ElimLt(n_occ))
- , bwdsub_assigns (0)
- , n_touched (0)
+SimpSolver::SimpSolver(CVC4::context::Context* c)
+ : Solver(c),
+ grow(opt_grow),
+ clause_lim(opt_clause_lim),
+ subsumption_lim(opt_subsumption_lim),
+ simp_garbage_frac(opt_simp_garbage_frac),
+ use_asymm(opt_use_asymm),
+ use_rcheck(opt_use_rcheck),
+ use_elim(opt_use_elim
+ && CVC4::options::bitblastMode()
+ == CVC4::options::BitblastMode::EAGER
+ && !CVC4::options::produceModels()),
+ merges(0),
+ asymm_lits(0),
+ eliminated_vars(0),
+ elimorder(1),
+ use_simplification(!PROOF_ON()),
+ occurs(ClauseDeleted(ca)),
+ elim_heap(ElimLt(n_occ)),
+ bwdsub_assigns(0),
+ n_touched(0)
{
vec<Lit> dummy(1,lit_Undef);
d_context = context;
- if( options::decisionMode() != decision::DECISION_STRATEGY_INTERNAL ) {
+ if (options::decisionMode() != options::DecisionMode::INTERNAL)
+ {
Notice() << "minisat: Incremental solving is forced on (to avoid variable elimination)"
<< " unless using internal decision strategy." << std::endl;
}
// Create the solver
- d_minisat = new Minisat::SimpSolver(theoryProxy, d_context,
- options::incrementalSolving() ||
- options::decisionMode() != decision::DECISION_STRATEGY_INTERNAL );
+ d_minisat = new Minisat::SimpSolver(
+ theoryProxy,
+ d_context,
+ options::incrementalSolving()
+ || options::decisionMode() != options::DecisionMode::INTERNAL);
d_statistics.init(d_minisat);
}
d_solution.clear();
// check whether we should print the status
if (d_result.asSatisfiabilityResult() != Result::UNSAT
- || options::sygusOut() == SYGUS_SOL_OUT_STATUS_AND_DEF
- || options::sygusOut() == SYGUS_SOL_OUT_STATUS)
+ || options::sygusOut() == options::SygusSolutionOutMode::STATUS_AND_DEF
+ || options::sygusOut() == options::SygusSolutionOutMode::STATUS)
{
- if (options::sygusOut() == SYGUS_SOL_OUT_STANDARD)
+ if (options::sygusOut() == options::SygusSolutionOutMode::STANDARD)
{
d_solution << "(fail)" << endl;
}
}
// check whether we should print the solution
if (d_result.asSatisfiabilityResult() == Result::UNSAT
- && options::sygusOut() != SYGUS_SOL_OUT_STATUS)
+ && options::sygusOut() != options::SygusSolutionOutMode::STATUS)
{
// printing a synthesis solution is a non-constant
// method, since it invokes a sophisticated algorithm
Expr ModelBlocker::getModelBlocker(const std::vector<Expr>& assertions,
theory::TheoryModel* m,
- BlockModelsMode mode,
+ options::BlockModelsMode mode,
const std::vector<Expr>& exprToBlock)
{
NodeManager* nm = NodeManager::currentNM();
}
Trace("model-blocker") << "Compute model blocker, assertions:" << std::endl;
Node blocker;
- if (mode == BLOCK_MODELS_LITERALS)
+ if (mode == options::BlockModelsMode::LITERALS)
{
Assert(nodesToBlock.empty());
// optimization: filter out top-level unit assertions, as they cannot
}
else
{
- Assert(mode == BLOCK_MODELS_VALUES);
+ Assert(mode == options::BlockModelsMode::VALUES);
std::vector<Node> blockers;
// if specific terms were not specified, block all variables of
// the model
* { t1 ... tn }; if exprToBlock is empty, then t1 ... tn are the free
* variables of assertions.
*
- * We expect exprToBlock to be non-empty only if mode is BLOCK_MODELS_VALUES.
+ * We expect exprToBlock to be non-empty only if mode is
+ * BlockModelsMode::VALUES.
*
* For example, if our input is:
* x > 0 ^ ( y < 0 V z < 0 V w < 0 )
static Expr getModelBlocker(
const std::vector<Expr>& assertions,
theory::TheoryModel* m,
- BlockModelsMode mode,
+ options::BlockModelsMode mode,
const std::vector<Expr>& exprToBlock = std::vector<Expr>());
}; /* class TheoryModelCoreBuilder */
bool ModelCoreBuilder::setModelCore(const std::vector<Expr>& assertions,
Model* m,
- ModelCoresMode mode)
+ options::ModelCoresMode mode)
{
if (Trace.isOn("model-core"))
{
std::vector<Node> coreVars;
std::vector<Node> impliedVars;
bool minimized = false;
- if (mode == MODEL_CORES_NON_IMPLIED)
+ if (mode == options::ModelCoresMode::NON_IMPLIED)
{
minimized = theory::SubstitutionMinimize::findWithImplied(
formula, vars, subs, coreVars, impliedVars);
}
- else if (mode == MODEL_CORES_SIMPLE)
+ else if (mode == options::ModelCoresMode::SIMPLE)
{
minimized = theory::SubstitutionMinimize::find(
formula, truen, vars, subs, coreVars);
* { s1 -> m(s1), ..., sn -> m(sn) }
*
* The criteria for what consistutes a model core given by mode. For
- * example, if mode is MODEL_CORES_SIMPLE, then a model core corresponds to a
- * subset of assignments from the model that suffice to show that the set of
- * assertions, interpreted conjunctively, evaluates to true under the
- * substitution corresponding to the model core.
+ * example, if mode is ModelCoresMode::SIMPLE, then a model core
+ * corresponds to a subset of assignments from the model that suffice to show
+ * that the set of assertions, interpreted conjunctively, evaluates to true
+ * under the substitution corresponding to the model core.
*
* The model core is recorded on the model object m via calls to
* m->setUsingModelCore, m->recordModelCoreSymbol, for details see
*/
static bool setModelCore(const std::vector<Expr>& assertions,
Model* m,
- ModelCoresMode mode);
+ options::ModelCoresMode mode);
}; /* class TheoryModelCoreBuilder */
} // namespace CVC4
#include "options/booleans_options.h"
#include "options/bv_options.h"
#include "options/datatypes_options.h"
-#include "options/decision_mode.h"
#include "options/decision_options.h"
#include "options/language.h"
#include "options/main_options.h"
#include "options/sep_options.h"
#include "options/set_language.h"
#include "options/smt_options.h"
-#include "options/strings_modes.h"
#include "options/strings_options.h"
#include "options/theory_options.h"
#include "options/uf_options.h"
}
bool is_sygus = language::isInputLangSygus(options::inputLanguage());
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER)
+ if (options::bitblastMode() == options::BitblastMode::EAGER)
{
if (options::produceModels()
&& (d_logic.isTheoryEnabled(THEORY_ARRAYS)
if ((options::checkModels() || options::checkSynthSol()
|| options::produceAbducts()
- || options::modelCoresMode() != MODEL_CORES_NONE
- || options::blockModelsMode() != BLOCK_MODELS_NONE)
+ || options::modelCoresMode() != options::ModelCoresMode::NONE
+ || options::blockModelsMode() != options::BlockModelsMode::NONE)
&& !options::produceAssertions())
{
Notice() << "SmtEngine: turning on produce-assertions to support "
// error if enabled explicitly
if (options::unsatCores() || options::proof())
{
- if (options::simplificationMode() != SIMPLIFICATION_MODE_NONE)
+ if (options::simplificationMode() != options::SimplificationMode::NONE)
{
if (options::simplificationMode.wasSetByUser())
{
Notice() << "SmtEngine: turning off simplification to support unsat "
"cores/proofs"
<< endl;
- options::simplificationMode.set(SIMPLIFICATION_MODE_NONE);
+ options::simplificationMode.set(options::SimplificationMode::NONE);
}
if (options::pbRewrites())
options::bitvectorToBool.set(false);
}
- if (options::boolToBitvector() != preprocessing::passes::BOOL_TO_BV_OFF)
+ if (options::boolToBitvector() != options::BoolToBVMode::OFF)
{
if (options::boolToBitvector.wasSetByUser())
{
<< d_logic.getLogicString() << "> " << (!qf_sat) << endl;
// simplification=none works better for SMT LIB benchmarks with
// quantifiers, not others options::simplificationMode.set(qf_sat ||
- // quantifiers ? SIMPLIFICATION_MODE_NONE : SIMPLIFICATION_MODE_BATCH);
- options::simplificationMode.set(qf_sat ? SIMPLIFICATION_MODE_NONE
- : SIMPLIFICATION_MODE_BATCH);
+ // quantifiers ? options::SimplificationMode::NONE :
+ // options::SimplificationMode::BATCH);
+ options::simplificationMode.set(qf_sat
+ ? options::SimplificationMode::NONE
+ : options::SimplificationMode::BATCH);
}
}
if (options::cbqiBv() && d_logic.isQuantified())
{
- if (options::boolToBitvector() != preprocessing::passes::BOOL_TO_BV_OFF)
+ if (options::boolToBitvector() != options::BoolToBVMode::OFF)
{
if (options::boolToBitvector.wasSetByUser())
{
!d_logic.isTheoryEnabled(THEORY_STRINGS) &&
!d_logic.isTheoryEnabled(THEORY_SETS) ) {
Trace("smt") << "setting theoryof-mode to term-based" << endl;
- options::theoryOfMode.set(THEORY_OF_TERM_BASED);
+ options::theoryOfMode.set(options::TheoryOfMode::THEORY_OF_TERM_BASED);
}
}
}
}
- if (options::boolToBitvector() == preprocessing::passes::BOOL_TO_BV_ALL
+ if (options::boolToBitvector() == options::BoolToBVMode::ALL
&& !d_logic.isTheoryEnabled(THEORY_BV))
{
if (options::boolToBitvector.wasSetByUser())
// Set decision mode based on logic (if not set by user)
if(!options::decisionMode.wasSetByUser()) {
- decision::DecisionMode decMode =
+ options::DecisionMode decMode =
// sygus uses internal
- is_sygus ? decision::DECISION_STRATEGY_INTERNAL :
+ is_sygus ? options::DecisionMode::INTERNAL :
// ALL
d_logic.hasEverything()
- ? decision::DECISION_STRATEGY_JUSTIFICATION
+ ? options::DecisionMode::JUSTIFICATION
: ( // QF_BV
- (not d_logic.isQuantified() && d_logic.isPure(THEORY_BV))
- ||
- // QF_AUFBV or QF_ABV or QF_UFBV
- (not d_logic.isQuantified()
- && (d_logic.isTheoryEnabled(THEORY_ARRAYS)
- || d_logic.isTheoryEnabled(THEORY_UF))
- && d_logic.isTheoryEnabled(THEORY_BV))
- ||
- // QF_AUFLIA (and may be ends up enabling
- // QF_AUFLRA?)
- (not d_logic.isQuantified()
- && d_logic.isTheoryEnabled(THEORY_ARRAYS)
- && d_logic.isTheoryEnabled(THEORY_UF)
- && d_logic.isTheoryEnabled(THEORY_ARITH))
- ||
- // QF_LRA
- (not d_logic.isQuantified()
- && d_logic.isPure(THEORY_ARITH)
- && d_logic.isLinear()
- && !d_logic.isDifferenceLogic()
- && !d_logic.areIntegersUsed())
- ||
- // Quantifiers
- d_logic.isQuantified() ||
- // Strings
- d_logic.isTheoryEnabled(THEORY_STRINGS)
- ? decision::DECISION_STRATEGY_JUSTIFICATION
- : decision::DECISION_STRATEGY_INTERNAL);
+ (not d_logic.isQuantified() && d_logic.isPure(THEORY_BV)) ||
+ // QF_AUFBV or QF_ABV or QF_UFBV
+ (not d_logic.isQuantified()
+ && (d_logic.isTheoryEnabled(THEORY_ARRAYS)
+ || d_logic.isTheoryEnabled(THEORY_UF))
+ && d_logic.isTheoryEnabled(THEORY_BV))
+ ||
+ // QF_AUFLIA (and may be ends up enabling
+ // QF_AUFLRA?)
+ (not d_logic.isQuantified()
+ && d_logic.isTheoryEnabled(THEORY_ARRAYS)
+ && d_logic.isTheoryEnabled(THEORY_UF)
+ && d_logic.isTheoryEnabled(THEORY_ARITH))
+ ||
+ // QF_LRA
+ (not d_logic.isQuantified()
+ && d_logic.isPure(THEORY_ARITH)
+ && d_logic.isLinear()
+ && !d_logic.isDifferenceLogic()
+ && !d_logic.areIntegersUsed())
+ ||
+ // Quantifiers
+ d_logic.isQuantified() ||
+ // Strings
+ d_logic.isTheoryEnabled(THEORY_STRINGS)
+ ? options::DecisionMode::JUSTIFICATION
+ : options::DecisionMode::INTERNAL);
bool stoponly =
// ALL
//apply fmfBoundInt options
if( options::fmfBound() ){
if (!options::mbqiMode.wasSetByUser()
- || (options::mbqiMode() != quantifiers::MBQI_NONE
- && options::mbqiMode() != quantifiers::MBQI_FMC))
+ || (options::mbqiMode() != options::MbqiMode::NONE
+ && options::mbqiMode() != options::MbqiMode::FMC))
{
//if bounded integers are set, use no MBQI by default
- options::mbqiMode.set( quantifiers::MBQI_NONE );
+ options::mbqiMode.set(options::MbqiMode::NONE);
}
if( ! options::prenexQuant.wasSetByUser() ){
- options::prenexQuant.set( quantifiers::PRENEX_QUANT_NONE );
+ options::prenexQuant.set(options::PrenexQuantMode::NONE);
}
}
if( options::ufHo() ){
//if higher-order, then current variants of model-based instantiation cannot be used
- if( options::mbqiMode()!=quantifiers::MBQI_NONE ){
- options::mbqiMode.set( quantifiers::MBQI_NONE );
+ if (options::mbqiMode() != options::MbqiMode::NONE)
+ {
+ options::mbqiMode.set(options::MbqiMode::NONE);
}
if (!options::hoElimStoreAx.wasSetByUser())
{
if( options::finiteModelFind() ){
//apply conservative quantifiers splitting
if( !options::quantDynamicSplit.wasSetByUser() ){
- options::quantDynamicSplit.set( quantifiers::QUANT_DSPLIT_MODE_DEFAULT );
+ options::quantDynamicSplit.set(options::QuantDSplitMode::DEFAULT);
}
//do not eliminate extended arithmetic symbols from quantified formulas
if( !options::elimExtArithQuant.wasSetByUser() ){
if( !options::instWhenMode.wasSetByUser() ){
//instantiate only on last call
if( options::eMatching() ){
- options::instWhenMode.set( quantifiers::INST_WHEN_LAST_CALL );
+ options::instWhenMode.set(options::InstWhenMode::LAST_CALL);
}
}
}
options::preSkolemQuantNested.set(true);
}
}
- if( options::cegqiSingleInvMode()!=quantifiers::CEGQI_SI_MODE_NONE ){
+ if (options::cegqiSingleInvMode() != options::CegqiSingleInvMode::NONE)
+ {
if( !options::ceGuidedInst.wasSetByUser() ){
options::ceGuidedInst.set( true );
}
if( options::ceGuidedInst() ){
//counterexample-guided instantiation for sygus
if( !options::cegqiSingleInvMode.wasSetByUser() ){
- options::cegqiSingleInvMode.set( quantifiers::CEGQI_SI_MODE_USE );
+ options::cegqiSingleInvMode.set(options::CegqiSingleInvMode::USE);
}
if( !options::quantConflictFind.wasSetByUser() ){
options::quantConflictFind.set( false );
// if doing abduction, we should filter strong solutions
if (!options::sygusFilterSolMode.wasSetByUser())
{
- options::sygusFilterSolMode.set(quantifiers::SYGUS_FILTER_SOL_STRONG);
+ options::sygusFilterSolMode.set(options::SygusFilterSolMode::STRONG);
}
// we must use basic sygus algorithms, since e.g. we require checking
// a sygus side condition for consistency with axioms.
}
if (!options::sygusInvTemplMode.wasSetByUser())
{
- options::sygusInvTemplMode.set(quantifiers::SYGUS_INV_TEMPL_MODE_NONE);
+ options::sygusInvTemplMode.set(options::SygusInvTemplMode::NONE);
}
if (!options::cegqiSingleInvMode.wasSetByUser())
{
- options::cegqiSingleInvMode.set(quantifiers::CEGQI_SI_MODE_NONE);
+ options::cegqiSingleInvMode.set(options::CegqiSingleInvMode::NONE);
}
}
//do not allow partial functions
}
if( !options::instWhenMode.wasSetByUser() && options::cbqiModel() ){
//only instantiation should happen at last call when model is avaiable
- options::instWhenMode.set( quantifiers::INST_WHEN_LAST_CALL );
+ options::instWhenMode.set(options::InstWhenMode::LAST_CALL);
}
}else{
// only supported in pure arithmetic or pure BV
if (options::cbqiNestedQE())
{
// only complete with prenex = disj_normal or normal
- if (options::prenexQuant() <= quantifiers::PRENEX_QUANT_DISJ_NORMAL)
+ if (options::prenexQuant() <= options::PrenexQuantMode::DISJ_NORMAL)
{
- options::prenexQuant.set(quantifiers::PRENEX_QUANT_DISJ_NORMAL);
+ options::prenexQuant.set(options::PrenexQuantMode::DISJ_NORMAL);
}
}
else if (options::globalNegate())
{
if (!options::prenexQuant.wasSetByUser())
{
- options::prenexQuant.set(quantifiers::PRENEX_QUANT_NONE);
+ options::prenexQuant.set(options::PrenexQuantMode::NONE);
}
}
}
//implied options...
if( options::strictTriggers() ){
if( !options::userPatternsQuant.wasSetByUser() ){
- options::userPatternsQuant.set( quantifiers::USER_PAT_MODE_TRUST );
+ options::userPatternsQuant.set(options::UserPatMode::TRUST);
}
}
if( options::qcfMode.wasSetByUser() || options::qcfTConstraint() ){
options::iteDtTesterSplitQuant.set( true );
}
if( !options::iteLiftQuant.wasSetByUser() ){
- options::iteLiftQuant.set( quantifiers::ITE_LIFT_QUANT_MODE_ALL );
+ options::iteLiftQuant.set(options::IteLiftQuantMode::ALL);
}
}
if( options::intWfInduction() ){
}
}
if( !d_logic.isTheoryEnabled(THEORY_DATATYPES) ){
- options::quantDynamicSplit.set( quantifiers::QUANT_DSPLIT_MODE_NONE );
+ options::quantDynamicSplit.set(options::QuantDSplitMode::NONE);
}
//until bugs 371,431 are fixed
Trace("smt") << "settting stringProcessLoopMode to 'simple' since "
"--strings-fmf enabled"
<< endl;
- options::stringProcessLoopMode.set(
- theory::strings::ProcessLoopMode::SIMPLE);
+ options::stringProcessLoopMode.set(options::ProcessLoopMode::SIMPLE);
}
}
Trace("simplify") << "SmtEnginePrivate::simplify()" << endl;
- if (options::simplificationMode() != SIMPLIFICATION_MODE_NONE)
+ if (options::simplificationMode() != options::SimplificationMode::NONE)
{
if (!options::unsatCores() && !options::fewerPreprocessingHoles())
{
}
if (options::repeatSimp()
- && options::simplificationMode() != SIMPLIFICATION_MODE_NONE
+ && options::simplificationMode() != options::SimplificationMode::NONE
&& !options::unsatCores() && !options::fewerPreprocessingHoles())
{
PreprocessingPassResult res =
d_passes["int-to-bv"]->apply(&d_assertions);
}
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER &&
- !d_smt.d_logic.isPure(THEORY_BV) &&
- d_smt.d_logic.getLogicString() != "QF_UFBV" &&
- d_smt.d_logic.getLogicString() != "QF_ABV") {
+ if (options::bitblastMode() == options::BitblastMode::EAGER
+ && !d_smt.d_logic.isPure(THEORY_BV)
+ && d_smt.d_logic.getLogicString() != "QF_UFBV"
+ && d_smt.d_logic.getLogicString() != "QF_ABV")
+ {
throw ModalException("Eager bit-blasting does not currently support theory combination. "
"Note that in a QF_BV problem UF symbols can be introduced for division. "
"Try --bv-div-zero-const to interpret division by zero as a constant.");
d_passes["bv-to-bool"]->apply(&d_assertions);
}
// Convert non-top-level Booleans to bit-vectors of size 1
- if (options::boolToBitvector())
+ if (options::boolToBitvector() != options::BoolToBVMode::OFF)
{
d_passes["bool-to-bv"]->apply(&d_assertions);
}
d_passes["theory-preprocess"]->apply(&d_assertions);
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER)
+ if (options::bitblastMode() == options::BitblastMode::EAGER)
{
d_passes["bv-eager-atoms"]->apply(&d_assertions);
}
// the theory engine into "eager model building" mode. TODO #2648: revisit.
d_theoryEngine->setEagerModelBuilding();
- if (options::modelCoresMode() != MODEL_CORES_NONE)
+ if (options::modelCoresMode() != options::ModelCoresMode::NONE)
{
// If we enabled model cores, we compute a model core for m based on our
// (expanded) assertions using the model core builder utility
TheoryModel* m = getAvailableModel("block model");
- if (options::blockModelsMode() == BLOCK_MODELS_NONE)
+ if (options::blockModelsMode() == options::BlockModelsMode::NONE)
{
std::stringstream ss;
ss << "Cannot block model when block-models is set to none.";
std::vector<Expr> eassertsProc = getExpandedAssertions();
// we always do block model values mode here
Expr eblocker = ModelBlocker::getModelBlocker(
- eassertsProc, m, BLOCK_MODELS_VALUES, exprs);
+ eassertsProc, m, options::BlockModelsMode::VALUES, exprs);
return assertFormula(eblocker);
}
void SmtEngine::printInstantiations( std::ostream& out ) {
SmtScope smts(this);
finalOptionsAreSet();
- if( options::instFormatMode()==INST_FORMAT_MODE_SZS ){
+ if (options::instFormatMode() == options::InstFormatMode::SZS)
+ {
out << "% SZS output start Proof for " << d_filename.c_str() << std::endl;
}
if( d_theoryEngine ){
}else{
Assert(false);
}
- if( options::instFormatMode()==INST_FORMAT_MODE_SZS ){
+ if (options::instFormatMode() == options::InstFormatMode::SZS)
+ {
out << "% SZS output end Proof for " << d_filename.c_str() << std::endl;
}
}
}
}
d_errorSet.reduceToSignals();
- d_errorSet.setSelectionRule(VAR_ORDER);
+ d_errorSet.setSelectionRule(options::ErrorSelectionRule::VAR_ORDER);
static int instance = 0;
++instance;
// We need to reduce this because of
d_errorSet.reduceToSignals();
- d_errorSet.setSelectionRule(VAR_ORDER);
+ d_errorSet.setSelectionRule(options::ErrorSelectionRule::VAR_ORDER);
if(processSignals()){
d_conflictVariables.purge();
if(!d_errorSet.errorEmpty() && result != Result::UNSAT){
if(exactResult){
- d_errorSet.setSelectionRule(VAR_ORDER);
+ d_errorSet.setSelectionRule(options::ErrorSelectionRule::VAR_ORDER);
while(!d_errorSet.errorEmpty() && result != Result::UNSAT){
Assert(checkPeriod > 0);
if(searchForFeasibleSolution(checkPeriod)){
}
}
}else if( options::arithStandardCheckVarOrderPivots() > 0){
- d_errorSet.setSelectionRule(VAR_ORDER);
+ d_errorSet.setSelectionRule(options::ErrorSelectionRule::VAR_ORDER);
if(searchForFeasibleSolution(options::arithStandardCheckVarOrderPivots())){
result = Result::UNSAT;
}
smtStatisticsRegistry()->unregisterStat(&d_enqueuesVarOrderModeDuplicates);
}
-ErrorSet::ErrorSet(ArithVariables& vars, TableauSizes tabSizes, BoundCountingLookup lookups):
- d_variables(vars),
- d_errInfo(),
- d_selectionRule(VAR_ORDER),
- d_focus(ComparatorPivotRule(this,d_selectionRule)),
- d_outOfFocus(),
- d_signals(),
- d_tableauSizes(tabSizes),
- d_boundLookup(lookups)
+ErrorSet::ErrorSet(ArithVariables& vars,
+ TableauSizes tabSizes,
+ BoundCountingLookup lookups)
+ : d_variables(vars),
+ d_errInfo(),
+ d_selectionRule(options::ErrorSelectionRule::VAR_ORDER),
+ d_focus(ComparatorPivotRule(this, d_selectionRule)),
+ d_outOfFocus(),
+ d_signals(),
+ d_tableauSizes(tabSizes),
+ d_boundLookup(lookups)
{}
-ErrorSelectionRule ErrorSet::getSelectionRule() const{
+options::ErrorSelectionRule ErrorSet::getSelectionRule() const
+{
return d_selectionRule;
}
-void ErrorSet::recomputeAmount(ErrorInformation& ei, ErrorSelectionRule rule){
+void ErrorSet::recomputeAmount(ErrorInformation& ei,
+ options::ErrorSelectionRule rule)
+{
switch(rule){
- case MINIMUM_AMOUNT:
- case MAXIMUM_AMOUNT:
- ei.setAmount(computeDiff(ei.getVariable()));
- break;
- case SUM_METRIC:
- ei.setMetric(sumMetric(ei.getVariable()));
- break;
- case VAR_ORDER:
- //do nothing
- break;
+ case options::ErrorSelectionRule::MINIMUM_AMOUNT:
+ case options::ErrorSelectionRule::MAXIMUM_AMOUNT:
+ ei.setAmount(computeDiff(ei.getVariable()));
+ break;
+ case options::ErrorSelectionRule::SUM_METRIC:
+ ei.setMetric(sumMetric(ei.getVariable()));
+ break;
+ case options::ErrorSelectionRule::VAR_ORDER:
+ // do nothing
+ break;
}
}
-void ErrorSet::setSelectionRule(ErrorSelectionRule rule){
+void ErrorSet::setSelectionRule(options::ErrorSelectionRule rule)
+{
if(rule != getSelectionRule()){
FocusSet into(ComparatorPivotRule(this, rule));
FocusSet::const_iterator iter = d_focus.begin();
Assert(getSelectionRule() == rule);
}
-ComparatorPivotRule::ComparatorPivotRule(const ErrorSet* es, ErrorSelectionRule r):
- d_errorSet(es), d_rule (r)
+ComparatorPivotRule::ComparatorPivotRule(const ErrorSet* es,
+ options::ErrorSelectionRule r)
+ : d_errorSet(es), d_rule(r)
{}
bool ComparatorPivotRule::operator()(ArithVar v, ArithVar u) const {
switch(d_rule){
- case VAR_ORDER:
- // This needs to be the reverse of the minVariableOrder
- return v > u;
- case SUM_METRIC:
+ case options::ErrorSelectionRule::VAR_ORDER:
+ // This needs to be the reverse of the minVariableOrder
+ return v > u;
+ case options::ErrorSelectionRule::SUM_METRIC:
{
uint32_t v_metric = d_errorSet->getMetric(v);
uint32_t u_metric = d_errorSet->getMetric(u);
return v_metric > u_metric;
}
}
- case MINIMUM_AMOUNT:
+ case options::ErrorSelectionRule::MINIMUM_AMOUNT:
{
const DeltaRational& vamt = d_errorSet->getAmount(v);
const DeltaRational& uamt = d_errorSet->getAmount(u);
return cmp > 0;
}
}
- case MAXIMUM_AMOUNT:
+ case options::ErrorSelectionRule::MAXIMUM_AMOUNT:
{
const DeltaRational& vamt = d_errorSet->getAmount(v);
const DeltaRational& uamt = d_errorSet->getAmount(u);
if(ei.inFocus()){
switch(getSelectionRule()){
- case MINIMUM_AMOUNT:
- case MAXIMUM_AMOUNT:
- ei.setAmount(computeDiff(ei.getVariable()));
- d_focus.update(ei.getHandle(), ei.getVariable());
- break;
- case SUM_METRIC:
- ei.setMetric(sumMetric(ei.getVariable()));
- d_focus.update(ei.getHandle(), ei.getVariable());
- break;
- case VAR_ORDER:
- //do nothing
- break;
+ case options::ErrorSelectionRule::MINIMUM_AMOUNT:
+ case options::ErrorSelectionRule::MAXIMUM_AMOUNT:
+ ei.setAmount(computeDiff(ei.getVariable()));
+ d_focus.update(ei.getHandle(), ei.getVariable());
+ break;
+ case options::ErrorSelectionRule::SUM_METRIC:
+ ei.setMetric(sumMetric(ei.getVariable()));
+ d_focus.update(ei.getHandle(), ei.getVariable());
+ break;
+ case options::ErrorSelectionRule::VAR_ORDER:
+ // do nothing
+ break;
}
}
}
ErrorInformation& ei = d_errInfo.get(v);
switch(getSelectionRule()){
- case MINIMUM_AMOUNT:
- case MAXIMUM_AMOUNT:
- ei.setAmount(computeDiff(v));
- break;
- case SUM_METRIC:
- ei.setMetric(sumMetric(ei.getVariable()));
- break;
- case VAR_ORDER:
- //do nothing
- break;
+ case options::ErrorSelectionRule::MINIMUM_AMOUNT:
+ case options::ErrorSelectionRule::MAXIMUM_AMOUNT:
+ ei.setAmount(computeDiff(v));
+ break;
+ case options::ErrorSelectionRule::SUM_METRIC:
+ ei.setMetric(sumMetric(ei.getVariable()));
+ break;
+ case options::ErrorSelectionRule::VAR_ORDER:
+ // do nothing
+ break;
}
ei.setInFocus(true);
FocusSetHandle handle = d_focus.push(v);
ErrorInformation& ei = d_errInfo.get(v);
Assert(!ei.inFocus());
switch(getSelectionRule()){
- case MINIMUM_AMOUNT:
- case MAXIMUM_AMOUNT:
- ei.setAmount(computeDiff(v));
- break;
- case SUM_METRIC:
- ei.setMetric(sumMetric(v));
- break;
- case VAR_ORDER:
- //do nothing
- break;
+ case options::ErrorSelectionRule::MINIMUM_AMOUNT:
+ case options::ErrorSelectionRule::MAXIMUM_AMOUNT:
+ ei.setAmount(computeDiff(v));
+ break;
+ case options::ErrorSelectionRule::SUM_METRIC:
+ ei.setMetric(sumMetric(v));
+ break;
+ case options::ErrorSelectionRule::VAR_ORDER:
+ // do nothing
+ break;
}
ei.setInFocus(true);
return diff;
}
-ostream& operator<<(ostream& out, ErrorSelectionRule rule) {
- switch(rule) {
- case VAR_ORDER:
- out << "VAR_ORDER";
- break;
- case MINIMUM_AMOUNT:
- out << "MINIMUM_AMOUNT";
- break;
- case MAXIMUM_AMOUNT:
- out << "MAXIMUM_AMOUNT";
- break;
- case SUM_METRIC:
- out << "SUM_METRIC";
- break;
- }
-
- return out;
-}
-
void ErrorSet::debugPrint(std::ostream& out) const {
static int instance = 0;
++instance;
#include <vector>
-#include "options/arith_heuristic_pivot_rule.h"
+#include "options/arith_options.h"
#include "theory/arith/arithvar.h"
#include "theory/arith/bound_counts.h"
#include "theory/arith/callbacks.h"
private:
const ErrorSet* d_errorSet;
- ErrorSelectionRule d_rule;
-public:
+ options::ErrorSelectionRule d_rule;
+
+ public:
ComparatorPivotRule();
- ComparatorPivotRule(const ErrorSet* es, ErrorSelectionRule r);
+ ComparatorPivotRule(const ErrorSet* es, options::ErrorSelectionRule r);
bool operator()(ArithVar v, ArithVar u) const;
- ErrorSelectionRule getRule() const { return d_rule; }
+ options::ErrorSelectionRule getRule() const { return d_rule; }
};
// typedef boost::heap::d_ary_heap<
*/
ErrorInfoMap d_errInfo;
- ErrorSelectionRule d_selectionRule;
+ options::ErrorSelectionRule d_selectionRule;
/**
* The ordered heap for the variables that are in ErrorSet.
*/
public:
DeltaRational computeDiff(ArithVar x) const;
private:
- void recomputeAmount(ErrorInformation& ei, ErrorSelectionRule r);
+ void recomputeAmount(ErrorInformation& ei, options::ErrorSelectionRule r);
- void update(ErrorInformation& ei);
- void transitionVariableOutOfError(ArithVar v);
- void transitionVariableIntoError(ArithVar v);
- void addBackIntoFocus(ArithVar v);
+ void update(ErrorInformation& ei);
+ void transitionVariableOutOfError(ArithVar v);
+ void transitionVariableIntoError(ArithVar v);
+ void addBackIntoFocus(ArithVar v);
public:
void pushErrorInto(ArithVarVec& vec) const;
void pushFocusInto(ArithVarVec& vec) const;
- ErrorSelectionRule getSelectionRule() const;
- void setSelectionRule(ErrorSelectionRule rule);
+ options::ErrorSelectionRule getSelectionRule() const;
+ void setSelectionRule(options::ErrorSelectionRule rule);
inline ArithVar topFocusVariable() const{
Assert(!focusEmpty());
d_errorSet.reduceToSignals();
// We must start tracking NOW
- d_errorSet.setSelectionRule(SUM_METRIC);
-
+ d_errorSet.setSelectionRule(options::ErrorSelectionRule::SUM_METRIC);
if(initialProcessSignals()){
d_conflictVariables.purge();
Trace("nl-ext-et-debug")
<< "Check entailment of " << ch_lemma << "..." << std::endl;
std::pair<bool, Node> et = d_containing.getValuation().entailmentCheck(
- THEORY_OF_TYPE_BASED, ch_lemma);
+ options::TheoryOfMode::THEORY_OF_TYPE_BASED, ch_lemma);
Trace("nl-ext-et-debug") << "entailment test result : " << et.first << " "
<< et.second << std::endl;
if (et.first)
DenseSet d_conflictVariables;
/** The rule to use for heuristic selection mode. */
- ErrorSelectionRule d_heuristicRule;
+ options::ErrorSelectionRule d_heuristicRule;
/** Linear equality module. */
LinearEqualityModule& d_linEq;
d_errorSet.reduceToSignals();
// We must start tracking NOW
- d_errorSet.setSelectionRule(SUM_METRIC);
+ d_errorSet.setSelectionRule(options::ErrorSelectionRule::SUM_METRIC);
if(initialProcessSignals()){
d_conflictVariables.purge();
<< "post approx cuts" << endl;
// This should be fine if sat or unknown
- if(!emmittedConflictOrSplit &&
- (options::arithPropagationMode() == UNATE_PROP ||
- options::arithPropagationMode() == BOTH_PROP)){
+ if (!emmittedConflictOrSplit
+ && (options::arithPropagationMode()
+ == options::ArithPropagationMode::UNATE_PROP
+ || options::arithPropagationMode()
+ == options::ArithPropagationMode::BOTH_PROP))
+ {
TimerStat::CodeTimer codeTimer(d_statistics.d_newPropTime);
Assert(d_qflraStatus != Result::UNSAT);
Debug("arith::conflict") << "unate arith conflict" << endl;
}
- }else{
+ }
+ else
+ {
TimerStat::CodeTimer codeTimer(d_statistics.d_newPropTime);
d_currentPropagationList.clear();
}
void TheoryArithPrivate::propagate(Theory::Effort e) {
// This uses model values for safety. Disable for now.
- if(d_qflraStatus == Result::SAT &&
- (options::arithPropagationMode() == BOUND_INFERENCE_PROP ||
- options::arithPropagationMode() == BOTH_PROP)
- && hasAnyUpdates()){
+ if (d_qflraStatus == Result::SAT
+ && (options::arithPropagationMode()
+ == options::ArithPropagationMode::BOUND_INFERENCE_PROP
+ || options::arithPropagationMode()
+ == options::ArithPropagationMode::BOTH_PROP)
+ && hasAnyUpdates())
+ {
if(options::newProp()){
propagateCandidatesNew();
}else{
propagateCandidates();
}
- }else{
+ }
+ else
+ {
clearUpdates();
}
vector<Node> lemmas;
if(!options::incrementalSolving()) {
switch(options::arithUnateLemmaMode()){
- case NO_PRESOLVE_LEMMAS:
- break;
- case INEQUALITY_PRESOLVE_LEMMAS:
- d_constraintDatabase.outputUnateInequalityLemmas(lemmas);
- break;
- case EQUALITY_PRESOLVE_LEMMAS:
- d_constraintDatabase.outputUnateEqualityLemmas(lemmas);
- break;
- case ALL_PRESOLVE_LEMMAS:
- d_constraintDatabase.outputUnateInequalityLemmas(lemmas);
- d_constraintDatabase.outputUnateEqualityLemmas(lemmas);
- break;
- default: Unhandled() << options::arithUnateLemmaMode();
+ case options::ArithUnateLemmaMode::NO: break;
+ case options::ArithUnateLemmaMode::INEQUALITY:
+ d_constraintDatabase.outputUnateInequalityLemmas(lemmas);
+ break;
+ case options::ArithUnateLemmaMode::EQUALITY:
+ d_constraintDatabase.outputUnateEqualityLemmas(lemmas);
+ break;
+ case options::ArithUnateLemmaMode::ALL:
+ d_constraintDatabase.outputUnateInequalityLemmas(lemmas);
+ d_constraintDatabase.outputUnateEqualityLemmas(lemmas);
+ break;
+ default: Unhandled() << options::arithUnateLemmaMode();
}
}
}
// if we are using the eager solver reverse the abstraction
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER)
+ if (options::bitblastMode() == options::BitblastMode::EAGER)
{
if (d_funcToSignature.size() == 0)
{
}
void AbstractionModule::addInputAtom(TNode atom) {
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_LAZY) {
+ if (options::bitblastMode() == options::BitblastMode::LAZY)
+ {
d_inputAtoms.insert(atom);
}
}
prop::SatSolver *solver = nullptr;
switch (options::bvSatSolver())
{
- case SAT_SOLVER_MINISAT:
+ case options::SatSolverMode::MINISAT:
{
prop::BVSatSolverInterface* minisat =
prop::SatSolverFactory::createMinisat(
solver = minisat;
break;
}
- case SAT_SOLVER_CADICAL:
+ case options::SatSolverMode::CADICAL:
solver = prop::SatSolverFactory::createCadical(smtStatisticsRegistry(),
"EagerBitblaster");
break;
- case SAT_SOLVER_CRYPTOMINISAT:
+ case options::SatSolverMode::CRYPTOMINISAT:
solver = prop::SatSolverFactory::createCryptoMinisat(
smtStatisticsRegistry(), "EagerBitblaster");
break;
Node atom_definition =
NodeManager::currentNM()->mkNode(kind::EQUAL, node, atom_bb);
- AlwaysAssert(options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER);
+ AlwaysAssert(options::bitblastMode() == options::BitblastMode::EAGER);
storeBBAtom(node, atom_bb);
d_cnfStream->convertAndAssert(
atom_definition, false, false, RULE_INVALID, TNode::null());
bool AlgebraicSolver::check(Theory::Effort e)
{
- Assert(options::bitblastMode() == theory::bv::BITBLAST_MODE_LAZY);
+ Assert(options::bitblastMode() == options::BitblastMode::LAZY);
if (!Theory::fullEffort(e)) { return true; }
if (!useHeuristic()) { return true; }
bool BitblastSolver::check(Theory::Effort e)
{
Debug("bv-bitblast") << "BitblastSolver::check (" << e << ")\n";
- Assert(options::bitblastMode() == theory::bv::BITBLAST_MODE_LAZY);
+ Assert(options::bitblastMode() == options::BitblastMode::LAZY);
++(d_statistics.d_numCallstoCheck);
if (d_coreTermCache.find(node) == d_coreTermCache.end()) {
Kind kind = node.getKind();
bool not_core;
- if (options::bitvectorEqualitySlicer() != BITVECTOR_SLICER_OFF) {
- not_core = (kind != kind::BITVECTOR_EXTRACT && kind != kind::BITVECTOR_CONCAT);
- } else {
- not_core = true;
+ if (options::bitvectorEqualitySlicer() != options::BvSlicerMode::OFF)
+ {
+ not_core =
+ (kind != kind::BITVECTOR_EXTRACT && kind != kind::BITVECTOR_CONCAT);
+ }
+ else
+ {
+ not_core = true;
}
if (not_core &&
kind != kind::EQUAL &&
setupExtTheory();
getExtTheory()->addFunctionKind(kind::BITVECTOR_TO_NAT);
getExtTheory()->addFunctionKind(kind::INT_TO_BITVECTOR);
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER) {
+ if (options::bitblastMode() == options::BitblastMode::EAGER)
+ {
d_eagerSolver.reset(new EagerBitblastSolver(c, this));
return;
}
TheoryBV::~TheoryBV() {}
void TheoryBV::setMasterEqualityEngine(eq::EqualityEngine* eq) {
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER) {
+ if (options::bitblastMode() == options::BitblastMode::EAGER)
+ {
return;
}
if (options::bitvectorEqualitySolver()) {
d_calledPreregister = true;
Debug("bitvector-preregister") << "TheoryBV::preRegister(" << node << ")" << std::endl;
- if (options::bitblastMode() == BITBLAST_MODE_EAGER)
+ if (options::bitblastMode() == options::BitblastMode::EAGER)
{
// the aig bit-blaster option is set heuristically
// if bv abstraction is used
// we may be getting new assertions so the model cache may not be sound
d_invalidateModelCache.set(true);
// if we are using the eager solver
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER) {
+ if (options::bitblastMode() == options::BitblastMode::EAGER)
+ {
// this can only happen on an empty benchmark
if (!d_eagerSolver->isInitialized()) {
d_eagerSolver->initialize();
return;
}
-
if (Theory::fullEffort(e)) {
++(d_statistics.d_numCallsToCheckFullEffort);
} else {
bool TheoryBV::collectModelInfo(TheoryModel* m)
{
Assert(!inConflict());
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER) {
+ if (options::bitblastMode() == options::BitblastMode::EAGER)
+ {
if (!d_eagerSolver->collectModelInfo(m, true))
{
return false;
void TheoryBV::propagate(Effort e) {
Debug("bitvector") << indent() << "TheoryBV::propagate()" << std::endl;
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER) {
+ if (options::bitblastMode() == options::BitblastMode::EAGER)
+ {
return;
}
EqualityStatus TheoryBV::getEqualityStatus(TNode a, TNode b)
{
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER)
+ if (options::bitblastMode() == options::BitblastMode::EAGER)
return EQUALITY_UNKNOWN;
- Assert(options::bitblastMode() == theory::bv::BITBLAST_MODE_LAZY);
+ Assert(options::bitblastMode() == options::BitblastMode::LAZY);
for (unsigned i = 0; i < d_subtheories.size(); ++i) {
EqualityStatus status = d_subtheories[i]->getEqualityStatus(a, b);
if (status != EQUALITY_UNKNOWN) {
bool TheoryBV::applyAbstraction(const std::vector<Node>& assertions, std::vector<Node>& new_assertions) {
bool changed = d_abstractionModule->applyAbstraction(assertions, new_assertions);
- if (changed &&
- options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER &&
- options::bitvectorAig()) {
+ if (changed && options::bitblastMode() == options::BitblastMode::EAGER
+ && options::bitvectorAig())
+ {
// disable AIG mode
AlwaysAssert(!d_eagerSolver->isInitialized());
d_eagerSolver->turnOffAig();
void TheoryBV::setProofLog(proof::BitVectorProof* bvp)
{
- if( options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER ){
+ if (options::bitblastMode() == options::BitblastMode::EAGER)
+ {
d_eagerSolver->setProofLog(bvp);
- }else{
+ }
+ else
+ {
for( unsigned i=0; i< d_subtheories.size(); i++ ){
d_subtheories[i]->setProofLog( bvp );
}
#include <vector>
+#include "options/theory_options.h"
#include "theory/theory.h"
namespace CVC4 {
continue;
}
- if (theory::Theory::theoryOf(theory::THEORY_OF_TERM_BASED, n)
+ if (theory::Theory::theoryOf(options::TheoryOfMode::THEORY_OF_TERM_BASED, n)
== theory::THEORY_BV)
{
Kind k = n.getKind();
Node m = n[0];
Trace("sygus-fair") << "Have sygus bound : " << n << ", polarity=" << polarity << " on measure " << m << std::endl;
registerMeasureTerm( m );
- if( options::sygusFair()==SYGUS_FAIR_DT_SIZE ){
+ if (options::sygusFair() == options::SygusFairMode::DT_SIZE)
+ {
std::map<Node, std::unique_ptr<SygusSizeDecisionStrategy>>::iterator its =
d_szinfo.find(m);
Assert(its != d_szinfo.end());
d_szinfo.find(m);
Assert(itsz != d_szinfo.end());
unsigned ssz = itsz->second->d_curr_search_size;
-
- if( options::sygusFair()==SYGUS_FAIR_DIRECT ){
+
+ if (options::sygusFair() == options::SygusFairMode::DIRECT)
+ {
if( dt[tindex].getNumArgs()>0 ){
quantifiers::SygusTypeInfo& nti = d_tds->getTypeInfo(ntn);
// consider lower bounds for size of types
{
Trace("sygus-sb-simple-debug") << " Size..." << std::endl;
// fairness
- if (options::sygusFair() == SYGUS_FAIR_DT_SIZE && !isAnyConstant)
+ if (options::sygusFair() == options::SygusFairMode::DT_SIZE
+ && !isAnyConstant)
{
Node szl = nm->mkNode(DT_SIZE, n);
Node szr = nm->mkNode(DT_SIZE, utils::getInstCons(n, dt, tindex));
d_szinfo[m]->d_anchors.push_back(e);
d_anchor_to_measure_term[e] = m;
NodeManager* nm = NodeManager::currentNM();
- if (options::sygusFair() == SYGUS_FAIR_DT_SIZE)
+ if (options::sygusFair() == options::SygusFairMode::DT_SIZE)
{
// update constraints on the measure term
Node slem;
{
isExc = false;
//debugging : ensure fairness was properly handled
- if( options::sygusFair()==SYGUS_FAIR_DT_SIZE ){
+ if (options::sygusFair() == options::SygusFairMode::DT_SIZE)
+ {
Node prog_sz = NodeManager::currentNM()->mkNode( kind::DT_SIZE, prog );
Node prog_szv = d_td->getValuation().getModel()->getValue( prog_sz );
Node progv_sz = NodeManager::currentNM()->mkNode( kind::DT_SIZE, progv );
Node SygusExtension::SygusSizeDecisionStrategy::mkLiteral(unsigned s)
{
- if (options::sygusFair() == SYGUS_FAIR_NONE)
+ if (options::sygusFair() == options::SygusFairMode::NONE)
{
return Node::null();
}
* lemmas on getSimpleSymBreakPred, see function below),
* (3) conjecture-specific symmetry breaking lemmas, see
* SynthConjecture::getSymmetryBreakingPredicate,
- * (4) fairness conflicts if sygusFair() is SYGUS_FAIR_DIRECT, e.g.:
+ * (4) fairness conflicts if sygusFair() is SygusFairMode::DIRECT, e.g.:
* size( d ) <= 1 V ~is-C1( d ) V ~is-C2( d.1 )
* where C1 and C2 are non-nullary constructors.
*/
* The measure value is an integer variable v that is a (symbolic) integer
* value that is constrained to be less than or equal to the current search
* size. For example, if we are using the fairness strategy
- * SYGUS_FAIR_DT_SIZE (see options/datatype_options.h), then we constrain:
- * (DT_SYGUS_BOUND m n) <=> (v <= n)
- * for all asserted fairness literals. Then, if we are enforcing fairness
- * based on the maximum size, we assert:
- * (DT_SIZE e) <= v
- * for all enumerators e.
+ * SygusFairMode::DT_SIZE (see options/datatype_options.h), then we
+ * constrain: (DT_SYGUS_BOUND m n) <=> (v <= n) for all asserted fairness
+ * literals. Then, if we are enforcing fairness based on the maximum size,
+ * we assert: (DT_SIZE e) <= v for all enumerators e.
*/
Node getOrMkMeasureValue(std::vector<Node>& lemmas);
/** get or make the active measure value
* The active measure value av is an integer variable that corresponds to
* the (symbolic) value of the sum of enumerators that are yet to be
* registered. This is to enforce the "sum of measures" strategy. For
- * example, if we are using the fairness strategy SYGUS_FAIR_DT_SIZE,
+ * example, if we are using the fairness strategy SygusFairMode::DT_SIZE,
* then initially av is equal to the measure value v, and the constraints
* (DT_SYGUS_BOUND m n) <=> (v <= n)
* are added as before. When an enumerator e is registered, we add the
{
return Node::null();
}
- else if (options::cbqiBvIneqMode() == CBQI_BV_INEQ_KEEP
+ else if (options::cbqiBvIneqMode() == options::CbqiBvIneqMode::KEEP
|| (pol && k == EQUAL))
{
return lit;
Trace("cegqi-bv") << " " << sm << " <> " << tm << std::endl;
Node ret;
- if (options::cbqiBvIneqMode() == CBQI_BV_INEQ_EQ_SLACK)
+ if (options::cbqiBvIneqMode() == options::CbqiBvIneqMode::EQ_SLACK)
{
// if using slack, we convert constraints to a positive equality based on
// the current model M, e.g.:
if( e==0 ){
return STATUS_UNFINISHED;
}else{
- int peffort = d_quantEngine->getInstUserPatMode()==USER_PAT_MODE_RESORT ? 2 : 1;
+ int peffort =
+ d_quantEngine->getInstUserPatMode() == options::UserPatMode::RESORT ? 2
+ : 1;
if( e<peffort ){
return STATUS_UNFINISHED;
}else if( e==peffort ){
d_counter[f]++;
Trace("inst-alg") << "-> User-provided instantiate " << f << "..." << std::endl;
- if( d_quantEngine->getInstUserPatMode()==USER_PAT_MODE_RESORT ){
+ if (d_quantEngine->getInstUserPatMode() == options::UserPatMode::RESORT)
+ {
for( unsigned i=0; i<d_user_gen_wait[f].size(); i++ ){
Trigger * t = Trigger::mkTrigger( d_quantEngine, f, d_user_gen_wait[f][i], true, Trigger::TR_RETURN_NULL );
if( t ){
if( usable ){
Trace("user-pat") << "Add user pattern: " << pat << " for " << q << std::endl;
//check match option
- if( d_quantEngine->getInstUserPatMode()==USER_PAT_MODE_RESORT ){
+ if (d_quantEngine->getInstUserPatMode() == options::UserPatMode::RESORT)
+ {
d_user_gen_wait[q].push_back( nodes );
- }else{
+ }
+ else
+ {
Trigger * t = Trigger::mkTrigger( d_quantEngine, q, nodes, true, Trigger::TR_MAKE_NEW );
if( t ){
d_user_gen[q].push_back( t );
}
int InstStrategyAutoGenTriggers::process( Node f, Theory::Effort effort, int e ){
- UserPatMode upMode = d_quantEngine->getInstUserPatMode();
- if( hasUserPatterns( f ) && upMode==USER_PAT_MODE_TRUST ){
+ options::UserPatMode upMode = d_quantEngine->getInstUserPatMode();
+ if (hasUserPatterns(f) && upMode == options::UserPatMode::TRUST)
+ {
return STATUS_UNKNOWN;
- }else{
- int peffort = ( hasUserPatterns( f ) && upMode!=USER_PAT_MODE_IGNORE && upMode!=USER_PAT_MODE_RESORT ) ? 2 : 1;
+ }
+ else
+ {
+ int peffort = (hasUserPatterns(f) && upMode != options::UserPatMode::IGNORE
+ && upMode != options::UserPatMode::RESORT)
+ ? 2
+ : 1;
if( e<peffort ){
return STATUS_UNFINISHED;
}else{
// d_processed_trigger.clear();
// d_quantEngine->getEqualityQuery()->setLiberal( true );
//}
- if( options::triggerActiveSelMode()!=TRIGGER_ACTIVE_SEL_ALL ){
+ if (options::triggerActiveSelMode() != options::TriggerActiveSelMode::ALL)
+ {
int max_score = -1;
Trigger * max_trigger = NULL;
for( std::map< Trigger*, bool >::iterator itt = d_auto_gen_trigger[0][f].begin(); itt != d_auto_gen_trigger[0][f].end(); ++itt ){
int score = itt->first->getActiveScore();
- if( options::triggerActiveSelMode()==TRIGGER_ACTIVE_SEL_MIN ){
+ if (options::triggerActiveSelMode()
+ == options::TriggerActiveSelMode::MIN)
+ {
if( score>=0 && ( score<max_score || max_score<0 ) ){
max_score = score;
max_trigger = itt->first;
- }
- }else{
+ }
+ }
+ else
+ {
if( score>max_score ){
max_score = score;
max_trigger = itt->first;
d_auto_gen_trigger[0][f][max_trigger] = true;
}
}
-
+
bool hasInst = false;
for( unsigned r=0; r<2; r++ ){
for( std::map< Trigger*, bool >::iterator itt = d_auto_gen_trigger[r][f].begin(); itt != d_auto_gen_trigger[r][f].end(); ++itt ){
}else{
Assert(Trigger::isAtomicTrigger(pat));
if( pat.getType().isBoolean() && rpoleq.isNull() ){
- if( options::literalMatchMode()==LITERAL_MATCH_USE ){
+ if (options::literalMatchMode() == options::LiteralMatchMode::USE)
+ {
pat = NodeManager::currentNM()->mkNode( EQUAL, pat, NodeManager::currentNM()->mkConst( rpol==-1 ) ).negate();
- }else if( options::literalMatchMode()!=LITERAL_MATCH_NONE ){
+ }
+ else if (options::literalMatchMode()
+ != options::LiteralMatchMode::NONE)
+ {
pat = NodeManager::currentNM()->mkNode( EQUAL, pat, NodeManager::currentNM()->mkConst( rpol==1 ) );
}
}else{
Assert(!rpoleq.isNull());
if( rpol==-1 ){
- if( options::literalMatchMode()!=LITERAL_MATCH_NONE ){
+ if (options::literalMatchMode()
+ != options::LiteralMatchMode::NONE)
+ {
//all equivalence classes except rpoleq
pat = NodeManager::currentNM()->mkNode( EQUAL, pat, rpoleq ).negate();
}
}else if( rpol==1 ){
- if( options::literalMatchMode()==LITERAL_MATCH_AGG ){
+ if (options::literalMatchMode()
+ == options::LiteralMatchMode::AGG)
+ {
//only equivalence class rpoleq
pat = NodeManager::currentNM()->mkNode( EQUAL, pat, rpoleq );
}
std::string identify() const override { return std::string("UserPatterns"); }
};/* class InstStrategyUserPatterns */
-class InstStrategyAutoGenTriggers : public InstStrategy {
-public:
- enum {
+class InstStrategyAutoGenTriggers : public InstStrategy
+{
+ public:
+ enum
+ {
RELEVANCE_NONE,
RELEVANCE_DEFAULT,
};
-private:
+
+ private:
/** trigger generation strategy */
- TriggerSelMode d_tr_strategy;
+ options::TriggerSelMode d_tr_strategy;
/** regeneration */
bool d_regenerate;
int d_regenerate_frequency;
/** (single,multi) triggers for each quantifier */
- std::map< Node, std::map< inst::Trigger*, bool > > d_auto_gen_trigger[2];
- std::map< Node, int > d_counter;
+ std::map<Node, std::map<inst::Trigger*, bool> > d_auto_gen_trigger[2];
+ std::map<Node, int> d_counter;
/** single, multi triggers for each quantifier */
- std::map< Node, std::vector< Node > > d_patTerms[2];
- std::map< Node, std::map< Node, bool > > d_patReqPol;
+ std::map<Node, std::vector<Node> > d_patTerms[2];
+ std::map<Node, std::map<Node, bool> > d_patReqPol;
/** information about triggers */
- std::map< Node, bool > d_is_single_trigger;
- std::map< Node, bool > d_single_trigger_gen;
- std::map< Node, bool > d_made_multi_trigger;
- //processed trigger this round
- std::map< Node, std::map< inst::Trigger*, bool > > d_processed_trigger;
- //instantiation no patterns
- std::map< Node, std::vector< Node > > d_user_no_gen;
+ std::map<Node, bool> d_is_single_trigger;
+ std::map<Node, bool> d_single_trigger_gen;
+ std::map<Node, bool> d_made_multi_trigger;
+ // processed trigger this round
+ std::map<Node, std::map<inst::Trigger*, bool> > d_processed_trigger;
+ // instantiation no patterns
+ std::map<Node, std::vector<Node> > d_user_no_gen;
// number of trigger variables per quantifier
- std::map< Node, unsigned > d_num_trigger_vars;
- std::map< Node, Node > d_vc_partition[2];
- std::map< Node, Node > d_pat_to_mpat;
-private:
+ std::map<Node, unsigned> d_num_trigger_vars;
+ std::map<Node, Node> d_vc_partition[2];
+ std::map<Node, Node> d_pat_to_mpat;
+
+ private:
/** process functions */
- void processResetInstantiationRound(Theory::Effort effort) override;
- int process(Node q, Theory::Effort effort, int e) override;
- /** generate triggers */
- void generateTriggers(Node q);
- void addPatternToPool(Node q, Node pat, unsigned num_fv, Node mpat);
- void addTrigger(inst::Trigger* tr, Node f);
- /** has user patterns */
- bool hasUserPatterns(Node q);
- /** has user patterns */
- std::map<Node, bool> d_hasUserPatterns;
+ void processResetInstantiationRound(Theory::Effort effort) override;
+ int process(Node q, Theory::Effort effort, int e) override;
+ /** generate triggers */
+ void generateTriggers(Node q);
+ void addPatternToPool(Node q, Node pat, unsigned num_fv, Node mpat);
+ void addTrigger(inst::Trigger* tr, Node f);
+ /** has user patterns */
+ bool hasUserPatterns(Node q);
+ /** has user patterns */
+ std::map<Node, bool> d_hasUserPatterns;
-public:
- InstStrategyAutoGenTriggers(QuantifiersEngine* qe, QuantRelevance* qr);
- ~InstStrategyAutoGenTriggers() {}
+ public:
+ InstStrategyAutoGenTriggers(QuantifiersEngine* qe, QuantRelevance* qr);
+ ~InstStrategyAutoGenTriggers() {}
-public:
+ public:
/** get auto-generated trigger */
- inst::Trigger* getAutoGenTrigger( Node q );
+ inst::Trigger* getAutoGenTrigger(Node q);
/** identify */
std::string identify() const override
{
return std::string("AutoGenTriggers");
}
/** add pattern */
- void addUserNoPattern( Node q, Node pat );
+ void addUserNoPattern(Node q, Node pat);
private:
/**
* owned by the instantiation engine that owns this class.
*/
QuantRelevance* d_quant_rel;
-};/* class InstStrategyAutoGenTriggers */
-
-
+}; /* class InstStrategyAutoGenTriggers */
}
}/* CVC4::theory namespace */
}/* CVC4 namespace */
if (options::eMatching()) {
// these are the instantiation strategies for E-matching
// user-provided patterns
- if (options::userPatternsQuant() != USER_PAT_MODE_IGNORE) {
+ if (options::userPatternsQuant() != options::UserPatMode::IGNORE)
+ {
d_isup.reset(new InstStrategyUserPatterns(d_quantEngine));
d_instStrategies.push_back(d_isup.get());
}
}
//store triggers in reqPol, indicating their polarity (if any) they must appear to falsify the quantified formula
-void Trigger::collectPatTerms2( Node q, Node n, std::map< Node, std::vector< Node > >& visited, std::map< Node, TriggerTermInfo >& tinfo,
- quantifiers::TriggerSelMode tstrt, std::vector< Node >& exclude, std::vector< Node >& added,
- bool pol, bool hasPol, bool epol, bool hasEPol, bool knowIsUsable ){
+void Trigger::collectPatTerms2(Node q,
+ Node n,
+ std::map<Node, std::vector<Node> >& visited,
+ std::map<Node, TriggerTermInfo>& tinfo,
+ options::TriggerSelMode tstrt,
+ std::vector<Node>& exclude,
+ std::vector<Node>& added,
+ bool pol,
+ bool hasPol,
+ bool epol,
+ bool hasEPol,
+ bool knowIsUsable)
+{
std::map< Node, std::vector< Node > >::iterator itv = visited.find( n );
if( itv==visited.end() ){
visited[ n ].clear();
Assert(added2[i] != nu);
// if child was not already removed
if( tinfo.find( added2[i] )!=tinfo.end() ){
- if( tstrt==quantifiers::TRIGGER_SEL_MAX || ( tstrt==quantifiers::TRIGGER_SEL_MIN_SINGLE_MAX && !nu_single ) ){
+ if (tstrt == options::TriggerSelMode::MAX
+ || (tstrt == options::TriggerSelMode::MIN_SINGLE_MAX
+ && !nu_single))
+ {
// discard all subterms
// do not remove if it has smaller weight
if (tinfo[nu].d_weight <= tinfo[added2[i]].d_weight)
visited[added2[i]].clear();
tinfo.erase(added2[i]);
}
- }else{
+ }
+ else
+ {
if( tinfo[ nu ].d_fv.size()==tinfo[ added2[i] ].d_fv.size() ){
if (tinfo[nu].d_weight >= tinfo[added2[i]].d_weight)
{
}
}
}
- if( rm_nu && ( tstrt==quantifiers::TRIGGER_SEL_MIN || ( tstrt==quantifiers::TRIGGER_SEL_MIN_SINGLE_ALL && nu_single ) ) ){
+ if (rm_nu
+ && (tstrt == options::TriggerSelMode::MIN
+ || (tstrt == options::TriggerSelMode::MIN_SINGLE_ALL
+ && nu_single)))
+ {
tinfo.erase( nu );
- }else{
+ }
+ else
+ {
if( std::find( added.begin(), added.end(), nu )==added.end() ){
added.push_back( nu );
}
return true;
}
-void Trigger::collectPatTerms( Node q, Node n, std::vector< Node >& patTerms, quantifiers::TriggerSelMode tstrt, std::vector< Node >& exclude,
- std::map< Node, TriggerTermInfo >& tinfo, bool filterInst ){
+void Trigger::collectPatTerms(Node q,
+ Node n,
+ std::vector<Node>& patTerms,
+ options::TriggerSelMode tstrt,
+ std::vector<Node>& exclude,
+ std::map<Node, TriggerTermInfo>& tinfo,
+ bool filterInst)
+{
std::map< Node, std::vector< Node > > visited;
if( filterInst ){
//immediately do not consider any term t for which another term is an instance of t
std::vector< Node > patTerms2;
std::map< Node, TriggerTermInfo > tinfo2;
- collectPatTerms( q, n, patTerms2, quantifiers::TRIGGER_SEL_ALL, exclude, tinfo2, false );
+ collectPatTerms(
+ q, n, patTerms2, options::TriggerSelMode::ALL, exclude, tinfo2, false);
std::vector< Node > temp;
temp.insert( temp.begin(), patTerms2.begin(), patTerms2.end() );
filterTriggerInstances(temp);
Trace("trigger-filter-instance") << std::endl;
}
}
- if( tstrt==quantifiers::TRIGGER_SEL_ALL ){
+ if (tstrt == options::TriggerSelMode::ALL)
+ {
for( unsigned i=0; i<temp.size(); i++ ){
//copy information
tinfo[temp[i]].d_fv.insert( tinfo[temp[i]].d_fv.end(), tinfo2[temp[i]].d_fv.begin(), tinfo2[temp[i]].d_fv.end() );
patTerms.push_back( temp[i] );
}
return;
- }else{
+ }
+ else
+ {
//do not consider terms that have instances
for( unsigned i=0; i<patTerms2.size(); i++ ){
if( std::find( temp.begin(), temp.end(), patTerms2[i] )==temp.end() ){
std::map< Node, TriggerTermInfo > tinfo;
// collect all patterns from n
std::vector< Node > exclude;
- collectPatTerms(q, n, patTerms, quantifiers::TRIGGER_SEL_ALL, exclude, tinfo);
+ collectPatTerms(q, n, patTerms, options::TriggerSelMode::ALL, exclude, tinfo);
//collect all variables from all patterns in patTerms, add to t_vars
for (const Node& pat : patTerms)
{
* in the vector we are returning, e.g. we do not return f( x ) if we are
* also returning f( f( x ) ). TODO: revisit this (issue #1211)
*/
- static void collectPatTerms( Node q, Node n, std::vector< Node >& patTerms, quantifiers::TriggerSelMode tstrt,
- std::vector< Node >& exclude, std::map< Node, TriggerTermInfo >& tinfo,
- bool filterInst = false );
+ static void collectPatTerms(Node q,
+ Node n,
+ std::vector<Node>& patTerms,
+ options::TriggerSelMode tstrt,
+ std::vector<Node>& exclude,
+ std::map<Node, TriggerTermInfo>& tinfo,
+ bool filterInst = false);
/** Is n a usable trigger in quantified formula q?
*
*
* We add the triggers we collected recursively in n into added.
*/
- static void collectPatTerms2( Node q, Node n, std::map< Node, std::vector< Node > >& visited, std::map< Node, TriggerTermInfo >& tinfo,
- quantifiers::TriggerSelMode tstrt, std::vector< Node >& exclude, std::vector< Node >& added,
- bool pol, bool hasPol, bool epol, bool hasEPol, bool knowIsUsable = false );
+ static void collectPatTerms2(Node q,
+ Node n,
+ std::map<Node, std::vector<Node> >& visited,
+ std::map<Node, TriggerTermInfo>& tinfo,
+ options::TriggerSelMode tstrt,
+ std::vector<Node>& exclude,
+ std::vector<Node>& added,
+ bool pol,
+ bool hasPol,
+ bool epol,
+ bool hasEPol,
+ bool knowIsUsable = false);
/** filter all nodes that have trigger instances
*
}
}
}
- if( options::quantRepMode()==quantifiers::QUANT_REP_MODE_EE ){
+ if (options::quantRepMode() == options::QuantRepMode::EE)
+ {
return r;
- }else{
+ }
+ else
+ {
TypeNode v_tn = q.isNull() ? a.getType() : q[0][index].getType();
std::map<Node, Node>& v_int_rep = d_int_rep[v_tn];
std::map<Node, Node>::const_iterator itir = v_int_rep.find(r);
return options::instLevelInputOnly() ? -1 : 0;
}
}else{
- if( options::quantRepMode()==quantifiers::QUANT_REP_MODE_FIRST ){
+ if (options::quantRepMode() == options::QuantRepMode::FIRST)
+ {
//score prefers earliest use of this term as a representative
return d_rep_score.find( n )==d_rep_score.end() ? -1 : d_rep_score[n];
- }else{
- Assert(options::quantRepMode() == quantifiers::QUANT_REP_MODE_DEPTH);
+ }
+ else
+ {
+ Assert(options::quantRepMode() == options::QuantRepMode::DEPTH);
return quantifiers::TermUtil::getTermDepth( n );
}
}
d_quant_cond[f] = op;
}
- if( options::mbqiMode()==MBQI_NONE ){
+ if (options::mbqiMode() == options::MbqiMode::NONE)
+ {
//just exhaustive instantiate
Node c = mkCondDefault( fmfmc, f );
d_quant_models[f].addEntry( fmfmc, c, d_false );
return exhaustiveInstantiate( fmfmc, f, c, -1);
- }else{
+ }
+ else
+ {
//model check the quantifier
doCheck(fmfmc, f, d_quant_models[f], f[1]);
Trace("fmc") << "Definition for quantifier " << f << " is : " << std::endl;
d_triedLemmas(0) {}
bool QModelBuilder::optUseModel() {
- return options::mbqiMode()!=MBQI_NONE || options::fmfBound();
+ return options::mbqiMode() != options::MbqiMode::NONE || options::fmfBound();
}
bool QModelBuilder::preProcessBuildModel(TheoryModel* m) {
Trace("model-engine-debug") << "Do exhaustive instantiation..." << std::endl;
// FMC uses two sub-effort levels
- int e_max = options::mbqiMode() == MBQI_FMC
+ int e_max = options::mbqiMode() == options::MbqiMode::FMC
? 2
- : (options::mbqiMode() == MBQI_TRUST ? 0 : 1);
+ : (options::mbqiMode() == options::MbqiMode::TRUST ? 0 : 1);
for( int e=0; e<e_max; e++) {
d_incomplete_quants.clear();
for( unsigned i=0; i<fm->getNumAssertedQuantifiers(); i++ ){
#include "expr/node_algorithm.h"
#include "options/quantifiers_options.h"
+#include "options/theory_options.h"
#include "smt/smt_statistics_registry.h"
#include "theory/quantifiers/ematching/trigger.h"
#include "theory/quantifiers/first_order_model.h"
}
//check if it is entailed
Trace("qcf-tconstraint-debug") << "Check entailment of " << rew << "..." << std::endl;
- std::pair<bool, Node> et = p->getQuantifiersEngine()->getTheoryEngine()->entailmentCheck(THEORY_OF_TYPE_BASED, rew );
+ std::pair<bool, Node> et =
+ p->getQuantifiersEngine()->getTheoryEngine()->entailmentCheck(
+ options::TheoryOfMode::THEORY_OF_TYPE_BASED, rew);
++(p->d_statistics.d_entailment_checks);
Trace("qcf-tconstraint-debug") << "ET result : " << et.first << " " << et.second << std::endl;
if( !et.first ){
bool performCheck = false;
if( options::quantConflictFind() && !d_conflict ){
if( level==Theory::EFFORT_LAST_CALL ){
- performCheck = options::qcfWhenMode()==QCF_WHEN_MODE_LAST_CALL;
+ performCheck = options::qcfWhenMode() == options::QcfWhenMode::LAST_CALL;
}else if( level==Theory::EFFORT_FULL ){
- performCheck = options::qcfWhenMode()==QCF_WHEN_MODE_DEFAULT;
+ performCheck = options::qcfWhenMode() == options::QcfWhenMode::DEFAULT;
}else if( level==Theory::EFFORT_STANDARD ){
- performCheck = options::qcfWhenMode()==QCF_WHEN_MODE_STD;
+ performCheck = options::qcfWhenMode() == options::QcfWhenMode::STD;
}
}
return performCheck;
// Returns the beginning of a range of efforts. The value returned is included
// in the range.
inline QuantConflictFind::Effort QcfEffortEnd() {
- return options::qcfMode() == QCF_PROP_EQ ? QuantConflictFind::EFFORT_PROP_EQ
- : QuantConflictFind::EFFORT_CONFLICT;
+ return options::qcfMode() == options::QcfMode::PROP_EQ
+ ? QuantConflictFind::EFFORT_PROP_EQ
+ : QuantConflictFind::EFFORT_CONFLICT;
}
} // namespace
}
else
{
- if( options::quantDynamicSplit()==quantifiers::QUANT_DSPLIT_MODE_AGG ){
+ if (options::quantDynamicSplit() == options::QuantDSplitMode::AGG)
+ {
// split if it is a finite datatype
doSplit = dt.isInterpretedFinite(tn);
- }else if( options::quantDynamicSplit()==quantifiers::QUANT_DSPLIT_MODE_DEFAULT ){
- if( !d_quantEngine->isFiniteBound( q, q[0][i] ) ){
+ }
+ else if (options::quantDynamicSplit()
+ == options::QuantDSplitMode::DEFAULT)
+ {
+ if (!d_quantEngine->isFiniteBound(q, q[0][i]))
+ {
if (dt.isInterpretedFinite(tn))
{
// split if goes from being unhandled -> handled by finite
return iti->second;
}else{
Node prev = ret;
- if( ret.getKind()==EQUAL && options::iteLiftQuant()!=ITE_LIFT_QUANT_MODE_NONE ){
+ if (ret.getKind() == EQUAL
+ && options::iteLiftQuant() != options::IteLiftQuantMode::NONE)
+ {
for( size_t i=0; i<2; i++ ){
if( ret[i].getKind()==ITE ){
Node no = i==0 ? ret[1] : ret[0];
if( no.getKind()!=ITE ){
- bool doRewrite = options::iteLiftQuant()==ITE_LIFT_QUANT_MODE_ALL;
+ bool doRewrite =
+ options::iteLiftQuant() == options::IteLiftQuantMode::ALL;
std::vector< Node > children;
children.push_back( ret[i][0] );
for( size_t j=1; j<=2; j++ ){
}
if( containsQuantifiers( n ) ){
Node ret = n;
- if( topLevel && options::prenexQuant()==PRENEX_QUANT_DISJ_NORMAL && ( n.getKind()==AND || ( n.getKind()==NOT && n[0].getKind()==OR ) ) ){
+ if (topLevel
+ && options::prenexQuant() == options::PrenexQuantMode::DISJ_NORMAL
+ && (n.getKind() == AND || (n.getKind() == NOT && n[0].getKind() == OR)))
+ {
std::vector< Node > children;
Node nc = n.getKind()==NOT ? n[0] : n;
for( unsigned i=0; i<nc.getNumChildren(); i++ ){
children.push_back( ncc );
}
ret = NodeManager::currentNM()->mkNode( AND, children );
- }else if( n.getKind()==NOT ){
+ }
+ else if (n.getKind() == NOT)
+ {
ret = computePrenexAgg( n[0], false, visited ).negate();
- }else if( n.getKind()==FORALL ){
- /*
- Node nn = computePrenexAgg( n[1], false );
- if( nn!=n[1] ){
- if( n.getNumChildren()==2 ){
- return NodeManager::currentNM()->mkNode( FORALL, n[0], nn );
- }else{
- return NodeManager::currentNM()->mkNode( FORALL, n[0], nn, n[2] );
+ }
+ else if (n.getKind() == FORALL)
+ {
+ /*
+ Node nn = computePrenexAgg( n[1], false );
+ if( nn!=n[1] ){
+ if( n.getNumChildren()==2 ){
+ return NodeManager::currentNM()->mkNode( FORALL, n[0], nn );
+ }else{
+ return NodeManager::currentNM()->mkNode( FORALL, n[0], nn, n[2] );
+ }
}
- }
- */
+ */
std::vector< Node > children;
- if( n[1].getKind()==OR && options::prenexQuant()==PRENEX_QUANT_DISJ_NORMAL ){
+ if (n[1].getKind() == OR
+ && options::prenexQuant() == options::PrenexQuantMode::DISJ_NORMAL)
+ {
for( unsigned i=0; i<n[1].getNumChildren(); i++ ){
children.push_back( computePrenexAgg( n[1][i], false, visited ) );
}
- }else{
+ }
+ else
+ {
children.push_back( computePrenexAgg( n[1], false, visited ) );
}
std::vector< Node > args;
}
Node nb = children.size()==1 ? children[0] : NodeManager::currentNM()->mkNode( OR, children );
ret = mkForall( args, nb, iplc, true );
- }else{
+ }
+ else
+ {
std::vector< Node > args;
std::vector< Node > nargs;
Node nn = computePrenex( n, args, nargs, true, true );
}
bool QuantifiersRewriter::doOperation( Node q, int computeOption, QAttributes& qa ){
- bool is_strict_trigger = qa.d_hasPattern && options::userPatternsQuant()==USER_PAT_MODE_TRUST;
+ bool is_strict_trigger =
+ qa.d_hasPattern
+ && options::userPatternsQuant() == options::UserPatMode::TRUST;
bool is_std = qa.isStandard() && !is_strict_trigger;
if (computeOption == COMPUTE_ELIM_SYMBOLS)
{
else if (computeOption == COMPUTE_PROCESS_TERMS)
{
return options::condRewriteQuant() || options::elimExtArithQuant()
- || options::iteLiftQuant() != ITE_LIFT_QUANT_MODE_NONE;
+ || options::iteLiftQuant() != options::IteLiftQuantMode::NONE;
}
else if (computeOption == COMPUTE_COND_SPLIT)
{
}
else if (computeOption == COMPUTE_PRENEX)
{
- return options::prenexQuant() != PRENEX_QUANT_NONE
+ return options::prenexQuant() != options::PrenexQuantMode::NONE
&& !options::aggressiveMiniscopeQuant() && is_std;
}
else if (computeOption == COMPUTE_VAR_ELIMINATION)
if( computeOption==COMPUTE_ELIM_SYMBOLS ){
n = computeElimSymbols( n );
}else if( computeOption==COMPUTE_MINISCOPING ){
- if( options::prenexQuant()==PRENEX_QUANT_DISJ_NORMAL || options::prenexQuant()==PRENEX_QUANT_NORMAL ){
+ if (options::prenexQuant() == options::PrenexQuantMode::DISJ_NORMAL
+ || options::prenexQuant() == options::PrenexQuantMode::NORMAL)
+ {
if( !qa.d_qid_num.isNull() ){
//already processed this, return self
return f;
}else if( computeOption==COMPUTE_COND_SPLIT ){
n = computeCondSplit(n, args, qa);
}else if( computeOption==COMPUTE_PRENEX ){
- if( options::prenexQuant()==PRENEX_QUANT_DISJ_NORMAL || options::prenexQuant()==PRENEX_QUANT_NORMAL ){
+ if (options::prenexQuant() == options::PrenexQuantMode::DISJ_NORMAL
+ || options::prenexQuant() == options::PrenexQuantMode::NORMAL)
+ {
//will rewrite at preprocess time
return f;
- }else{
+ }
+ else
+ {
std::vector< Node > nargs;
n = computePrenex( n, args, nargs, true, false );
Assert(nargs.empty());
}
}
//pull all quantifiers globally
- if( options::prenexQuant()==PRENEX_QUANT_DISJ_NORMAL || options::prenexQuant()==PRENEX_QUANT_NORMAL ){
+ if (options::prenexQuant() == options::PrenexQuantMode::DISJ_NORMAL
+ || options::prenexQuant() == options::PrenexQuantMode::NORMAL)
+ {
Trace("quantifiers-prenex") << "Prenexing : " << n << std::endl;
std::map< unsigned, std::map< Node, Node > > visited;
n = quantifiers::QuantifiersRewriter::computePrenexAgg( n, true, visited );
void QueryGenerator::checkQuery(Node qy, unsigned spIndex)
{
// external query
- if (options::sygusQueryGenDumpFiles() == SYGUS_QUERY_DUMP_ALL)
+ if (options::sygusQueryGenDumpFiles()
+ == options::SygusQueryDumpFilesMode::ALL)
{
dumpQuery(qy, spIndex);
}
ss << "but CVC4 answered unsat!" << std::endl;
AlwaysAssert(false) << ss.str();
}
- if (options::sygusQueryGenDumpFiles() == SYGUS_QUERY_DUMP_UNSOLVED)
+ if (options::sygusQueryGenDumpFiles()
+ == options::SygusQueryDumpFilesMode::UNSOLVED)
{
if (r.asSatisfiabilityResult().isSat() != Result::SAT)
{
{
// We are fully single invocation, set single invocation if we haven't
// disabled single invocation techniques.
- if (options::cegqiSingleInvMode() != CEGQI_SI_MODE_NONE)
+ if (options::cegqiSingleInvMode() != options::CegqiSingleInvMode::NONE)
{
d_single_invocation = true;
return;
// We are processing without single invocation techniques, now check if
// we should fix an invariant template (post-condition strengthening or
// pre-condition weakening).
- SygusInvTemplMode tmode = options::sygusInvTemplMode();
- if (tmode != SYGUS_INV_TEMPL_MODE_NONE)
+ options::SygusInvTemplMode tmode = options::sygusInvTemplMode();
+ if (tmode != options::SygusInvTemplMode::NONE)
{
// currently only works for single predicate synthesis
if (q[0].getNumChildren() > 1 || !q[0][0].getType().isPredicate())
{
- tmode = SYGUS_INV_TEMPL_MODE_NONE;
+ tmode = options::SygusInvTemplMode::NONE;
}
else if (!options::sygusInvTemplWhenSyntax())
{
// only use invariant templates if no syntactic restrictions
if (CegGrammarConstructor::hasSyntaxRestrictions(q))
{
- tmode = SYGUS_INV_TEMPL_MODE_NONE;
+ tmode = options::SygusInvTemplMode::NONE;
}
}
}
- if (tmode == SYGUS_INV_TEMPL_MODE_NONE)
+ if (tmode == options::SygusInvTemplMode::NONE)
{
// not processing invariant templates
return;
<< std::endl;
if (templ.isNull())
{
- if (tmode == SYGUS_INV_TEMPL_MODE_PRE)
+ if (tmode == options::SygusInvTemplMode::PRE)
{
templ = nm->mkNode(OR, d_trans_pre[prog], d_templ_arg[prog]);
}
else
{
- Assert(tmode == SYGUS_INV_TEMPL_MODE_POST);
+ Assert(tmode == options::SygusInvTemplMode::POST);
templ = nm->mkNode(AND, d_trans_post[prog], d_templ_arg[prog]);
}
}
void CegSingleInv::finishInit(bool syntaxRestricted)
{
Trace("cegqi-si-debug") << "Single invocation: finish init" << std::endl;
- // do not do single invocation if grammar is restricted and CEGQI_SI_MODE_ALL is not enabled
- if( options::cegqiSingleInvMode()==CEGQI_SI_MODE_USE && d_single_invocation && syntaxRestricted ){
+ // do not do single invocation if grammar is restricted and
+ // options::CegqiSingleInvMode::ALL is not enabled
+ if (options::cegqiSingleInvMode() == options::CegqiSingleInvMode::USE
+ && d_single_invocation && syntaxRestricted)
+ {
d_single_invocation = false;
Trace("cegqi-si") << "...grammar is restricted, do not use single invocation techniques." << std::endl;
}
//reconstruct the solution into sygus if necessary
reconstructed = 0;
- if (options::cegqiSingleInvReconstruct() != CEGQI_SI_RCONS_MODE_NONE
+ if (options::cegqiSingleInvReconstruct()
+ != options::CegqiSingleInvRconsMode::NONE
&& !dt.getSygusAllowAll() && !stn.isNull() && rconsSygus)
{
d_sol->preregisterConjecture( d_orig_conjecture );
int enumLimit = -1;
- if (options::cegqiSingleInvReconstruct() == CEGQI_SI_RCONS_MODE_TRY)
+ if (options::cegqiSingleInvReconstruct()
+ == options::CegqiSingleInvRconsMode::TRY)
{
enumLimit = 0;
}
else if (options::cegqiSingleInvReconstruct()
- == CEGQI_SI_RCONS_MODE_ALL_LIMIT)
+ == options::CegqiSingleInvRconsMode::ALL_LIMIT)
{
enumLimit = options::cegqiSingleInvReconstructLimit();
}
}
// assign the cegis sampler if applicable
- if (options::cegisSample() != CEGIS_SAMPLE_NONE)
+ if (options::cegisSample() != options::CegisSampleMode::NONE)
{
Trace("cegis-sample") << "Initialize sampler for " << d_base_body << "..."
<< std::endl;
// grammar construction was not simple.
bool useSymCons = false;
if (options::sygusRepairConst()
- || options::sygusGrammarConsMode() != SYGUS_GCONS_SIMPLE)
+ || options::sygusGrammarConsMode()
+ != options::SygusGrammarConsMode::SIMPLE)
{
TypeNode ctn = candidates[i].getType();
d_tds->registerSygusType(ctn);
return false;
}
- if (options::cegisSample() != CEGIS_SAMPLE_NONE && lems.empty())
+ if (options::cegisSample() != options::CegisSampleMode::NONE && lems.empty())
{
// if we didn't add a lemma, trying sampling to add a refinement lemma
// that immediately refutes the candidate we just constructed
Trace("cegqi-engine") << " *** Refine by sampling" << std::endl;
addRefinementLemma(rlem);
// if trust, we are not interested in sending out refinement lemmas
- if (options::cegisSample() != CEGIS_SAMPLE_TRUST)
+ if (options::cegisSample() != options::CegisSampleMode::TRUST)
{
Node lem = nm->mkNode(OR, d_parent->getGuard().negate(), rlem);
lems.push_back(lem);
{
d_initialized = false;
d_tds = d_qe->getTermDatabaseSygus();
- SygusUnifPiMode mode = options::sygusUnifPi();
- d_useCondPool =
- mode == SYGUS_UNIF_PI_CENUM || mode == SYGUS_UNIF_PI_CENUM_IGAIN;
+ options::SygusUnifPiMode mode = options::sygusUnifPi();
+ d_useCondPool = mode == options::SygusUnifPiMode::CENUM
+ || mode == options::SygusUnifPiMode::CENUM_IGAIN;
}
Node CegisUnifEnumDecisionStrategy::mkLiteral(unsigned n)
}
Trace("cegis-unif-enum") << "* Registering new enumerator " << e
<< " to strategy point " << si.d_pt << "\n";
- bool useSymCons = options::sygusGrammarConsMode() != SYGUS_GCONS_SIMPLE;
+ bool useSymCons =
+ options::sygusGrammarConsMode() != options::SygusGrammarConsMode::SIMPLE;
d_tds->registerEnumerator(e, si.d_pt, d_parent, erole, useSymCons);
}
itc;
// maps types to the index of its "any term" grammar construction
std::map<TypeNode, unsigned> typeToGAnyTerm;
- SygusGrammarConsMode sgcm = options::sygusGrammarConsMode();
+ options::SygusGrammarConsMode sgcm = options::sygusGrammarConsMode();
for (unsigned i = 0, size = types.size(); i < size; ++i)
{
std::stringstream ss;
{
Trace("sygus-grammar-def") << "Make grammar for " << types[i] << " " << unres_types[i] << std::endl;
TypeNode unres_t = unres_types[i];
- SygusGrammarConsMode tsgcm = sgcm;
- if (tsgcm == SYGUS_GCONS_ANY_TERM || tsgcm == SYGUS_GCONS_ANY_TERM_CONCISE)
+ options::SygusGrammarConsMode tsgcm = sgcm;
+ if (tsgcm == options::SygusGrammarConsMode::ANY_TERM
+ || tsgcm == options::SygusGrammarConsMode::ANY_TERM_CONCISE)
{
// If the type does not support any term, we do any constant instead.
// We also fall back on any constant construction if the type has no
// constructors at this point (e.g. it simply encodes all constants).
if (!types[i].isReal())
{
- tsgcm = SYGUS_GCONS_ANY_CONST;
+ tsgcm = options::SygusGrammarConsMode::ANY_CONST;
}
else
{
//add constants
std::vector<Node> consts;
mkSygusConstantsForType(types[i], consts);
- if (tsgcm == SYGUS_GCONS_ANY_CONST)
+ if (tsgcm == options::SygusGrammarConsMode::ANY_CONST)
{
// Use the any constant constructor. Notice that for types that don't
// have constants (e.g. uninterpreted or function types), we don't add
// the references).
const SygusDatatype& sdti = sdts[i].d_sdt;
// whether we will use the polynomial grammar
- bool polynomialGrammar = sgcm == SYGUS_GCONS_ANY_TERM_CONCISE;
+ bool polynomialGrammar =
+ sgcm == options::SygusGrammarConsMode::ANY_TERM_CONCISE;
// A set of constructor indices that will be used in the overall sum we
// are constructing; indices of constructors corresponding to builtin
// arithmetic operators will be excluded from this set.
// TODO #1935 ITEs are added to Boolean grammars so that we can infer
// unification strategies. We can do away with this if we can infer
// unification strategies from and/or/not
- if (k == ITE && options::sygusUnifPi() == SYGUS_UNIF_PI_NONE)
+ if (k == ITE && options::sygusUnifPi() == options::SygusUnifPiMode::NONE)
{
continue;
}
d_cand_to_hd_count[f] = 0;
}
// check whether we are using condition enumeration
- SygusUnifPiMode mode = options::sygusUnifPi();
- d_useCondPool =
- mode == SYGUS_UNIF_PI_CENUM || mode == SYGUS_UNIF_PI_CENUM_IGAIN;
- d_useCondPoolIGain = mode == SYGUS_UNIF_PI_CENUM_IGAIN;
+ options::SygusUnifPiMode mode = options::sygusUnifPi();
+ d_useCondPool = mode == options::SygusUnifPiMode::CENUM
+ || mode == options::SygusUnifPiMode::CENUM_IGAIN;
+ d_useCondPoolIGain = mode == options::SygusUnifPiMode::CENUM_IGAIN;
}
void SygusUnifRl::notifyEnumeration(Node e, Node v, std::vector<Node>& lemmas)
{
d_modules.push_back(d_ceg_pbe.get());
}
- if (options::sygusUnifPi() != SYGUS_UNIF_PI_NONE)
+ if (options::sygusUnifPi() != options::SygusUnifPiMode::NONE)
{
d_modules.push_back(d_ceg_cegisUnif.get());
}
bool sk_refine = (!isGround() || d_refine_count == 0) && constructed_cand;
if (sk_refine)
{
- if (options::cegisSample() == CEGIS_SAMPLE_TRUST)
+ if (options::cegisSample() == options::CegisSampleMode::TRUST)
{
// we have that the current candidate passed a sample test
// since we trust sampling in this mode, we assert there is no
// or basic. The auto mode always prefers the optimized enumerator over
// the basic one.
Assert(d_tds->isBasicEnumerator(e));
- if (options::sygusActiveGenMode() == SYGUS_ACTIVE_GEN_ENUM_BASIC)
+ if (options::sygusActiveGenMode()
+ == options::SygusActiveGenMode::ENUM_BASIC)
{
d_evg[e].reset(new EnumValGeneratorBasic(d_tds, e.getType()));
}
else
{
- Assert(options::sygusActiveGenMode() == SYGUS_ACTIVE_GEN_ENUM
- || options::sygusActiveGenMode() == SYGUS_ACTIVE_GEN_AUTO);
+ Assert(options::sygusActiveGenMode()
+ == options::SygusActiveGenMode::ENUM
+ || options::sygusActiveGenMode()
+ == options::SygusActiveGenMode::AUTO);
d_evg[e].reset(new SygusEnumerator(d_tds, this));
}
}
if (status != 0
&& (options::sygusRewSynth() || options::sygusQueryGen()
- || options::sygusFilterSolMode() != SYGUS_FILTER_SOL_NONE))
+ || options::sygusFilterSolMode()
+ != options::SygusFilterSolMode::NONE))
{
Trace("cegqi-sol-debug") << "Run expression mining..." << std::endl;
std::map<Node, ExpressionMinerManager>::iterator its =
{
d_exprm[prog].enableQueryGeneration(options::sygusQueryGenThresh());
}
- if (options::sygusFilterSolMode() != SYGUS_FILTER_SOL_NONE)
+ if (options::sygusFilterSolMode()
+ != options::SygusFilterSolMode::NONE)
{
- if (options::sygusFilterSolMode() == SYGUS_FILTER_SOL_STRONG)
+ if (options::sygusFilterSolMode()
+ == options::SygusFilterSolMode::STRONG)
{
d_exprm[prog].enableFilterStrongSolutions();
}
- else if (options::sygusFilterSolMode() == SYGUS_FILTER_SOL_WEAK)
+ else if (options::sygusFilterSolMode()
+ == options::SygusFilterSolMode::WEAK)
{
d_exprm[prog].enableFilterWeakSolutions();
}
// determine if we are actively-generated
bool isActiveGen = false;
- if (options::sygusActiveGenMode() != SYGUS_ACTIVE_GEN_NONE)
+ if (options::sygusActiveGenMode() != options::SygusActiveGenMode::NONE)
{
if (erole == ROLE_ENUM_MULTI_SOLUTION || erole == ROLE_ENUM_CONSTRAINED)
{
{
// If the enumerator is the single function-to-synthesize, if auto is
// enabled, we infer whether it is better to enable active generation.
- if (options::sygusActiveGenMode() == SYGUS_ACTIVE_GEN_AUTO)
+ if (options::sygusActiveGenMode() == options::SygusActiveGenMode::AUTO)
{
// We use active generation if the grammar of the enumerator does not
// have ITE and is not Boolean. Experimentally, it is better to
<< " returned " << isActiveGen << std::endl;
// Currently, actively-generated enumerators are either basic or variable
// agnostic.
- bool isVarAgnostic =
- isActiveGen
- && options::sygusActiveGenMode() == SYGUS_ACTIVE_GEN_VAR_AGNOSTIC;
+ bool isVarAgnostic = isActiveGen
+ && options::sygusActiveGenMode()
+ == options::SygusActiveGenMode::VAR_AGNOSTIC;
d_enum_var_agnostic[e] = isVarAgnostic;
if (isVarAgnostic)
{
#include "options/base_options.h"
#include "options/quantifiers_options.h"
+#include "options/theory_options.h"
#include "options/uf_options.h"
+#include "theory/quantifiers/ematching/trigger.h"
#include "theory/quantifiers/quantifiers_attributes.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/quantifiers/ematching/trigger.h"
#include "theory/quantifiers_engine.h"
#include "theory/theory_engine.h"
for (unsigned j = 0; j < 2; j++)
{
std::pair<bool, Node> et = te->entailmentCheck(
- THEORY_OF_TYPE_BASED, j == 0 ? ret : ret.negate());
+ options::TheoryOfMode::THEORY_OF_TYPE_BASED,
+ j == 0 ? ret : ret.negate());
if (et.first)
{
ret = j == 0 ? d_true : d_false;
return d_has_map.find( n )!=d_has_map.end();
}else{
//return d_quantEngine->getActiveEqualityEngine()->hasTerm( n ); //some assertions are not sent to EE
- if( options::termDbMode()==TERM_DB_ALL ){
+ if (options::termDbMode() == options::TermDbMode::ALL)
+ {
return true;
- }else if( options::termDbMode()==TERM_DB_RELEVANT ){
+ }
+ else if (options::termDbMode() == options::TermDbMode::RELEVANT)
+ {
return d_has_map.find( n )!=d_has_map.end();
- }else{
+ }
+ else
+ {
Assert(false);
return false;
}
}
//compute has map
- if( options::termDbMode()==TERM_DB_RELEVANT || options::lteRestrictInstClosure() ){
+ if (options::termDbMode() == options::TermDbMode::RELEVANT
+ || options::lteRestrictInstClosure())
+ {
d_has_map.clear();
d_term_elig_eqc.clear();
eq::EqClassesIterator eqcs_i = eq::EqClassesIterator( ee );
d_lte_part_inst.reset(new quantifiers::LtePartialInst(qe, c));
modules.push_back(d_lte_part_inst.get());
}
- if (options::quantDynamicSplit() != quantifiers::QUANT_DSPLIT_MODE_NONE)
+ if (options::quantDynamicSplit() != options::QuantDSplitMode::NONE)
{
d_qsplit.reset(new quantifiers::QuantDSplit(qe, c));
modules.push_back(d_qsplit.get());
// if we require specialized ways of building the model
if( needsBuilder ){
Trace("quant-engine-debug") << "Initialize model engine, mbqi : " << options::mbqiMode() << " " << options::fmfBound() << std::endl;
- if (options::mbqiMode() == quantifiers::MBQI_FMC
- || options::mbqiMode() == quantifiers::MBQI_TRUST
+ if (options::mbqiMode() == options::MbqiMode::FMC
+ || options::mbqiMode() == options::MbqiMode::TRUST
|| options::fmfBound())
{
Trace("quant-engine-debug") << "...make fmc builder." << std::endl;
Trace("quant-engine-debug2") << "Get inst when needs check, counts=" << d_ierCounter << ", " << d_ierCounter_lc << std::endl;
//determine if we should perform check, based on instWhenMode
bool performCheck = false;
- if( options::instWhenMode()==quantifiers::INST_WHEN_FULL ){
+ if (options::instWhenMode() == options::InstWhenMode::FULL)
+ {
performCheck = ( e >= Theory::EFFORT_FULL );
- }else if( options::instWhenMode()==quantifiers::INST_WHEN_FULL_DELAY ){
+ }
+ else if (options::instWhenMode() == options::InstWhenMode::FULL_DELAY)
+ {
performCheck = ( e >= Theory::EFFORT_FULL ) && !getTheoryEngine()->needCheck();
- }else if( options::instWhenMode()==quantifiers::INST_WHEN_FULL_LAST_CALL ){
+ }
+ else if (options::instWhenMode() == options::InstWhenMode::FULL_LAST_CALL)
+ {
performCheck = ( ( e==Theory::EFFORT_FULL && d_ierCounter%d_inst_when_phase!=0 ) || e==Theory::EFFORT_LAST_CALL );
- }else if( options::instWhenMode()==quantifiers::INST_WHEN_FULL_DELAY_LAST_CALL ){
+ }
+ else if (options::instWhenMode()
+ == options::InstWhenMode::FULL_DELAY_LAST_CALL)
+ {
performCheck = ( ( e==Theory::EFFORT_FULL && !getTheoryEngine()->needCheck() && d_ierCounter%d_inst_when_phase!=0 ) || e==Theory::EFFORT_LAST_CALL );
- }else if( options::instWhenMode()==quantifiers::INST_WHEN_LAST_CALL ){
+ }
+ else if (options::instWhenMode() == options::InstWhenMode::LAST_CALL)
+ {
performCheck = ( e >= Theory::EFFORT_LAST_CALL );
- }else{
+ }
+ else
+ {
performCheck = true;
}
if( e==Theory::EFFORT_LAST_CALL ){
return performCheck;
}
-quantifiers::UserPatMode QuantifiersEngine::getInstUserPatMode() {
- if( options::userPatternsQuant()==quantifiers::USER_PAT_MODE_INTERLEAVE ){
- return d_ierCounter%2==0 ? quantifiers::USER_PAT_MODE_USE : quantifiers::USER_PAT_MODE_RESORT;
- }else{
+options::UserPatMode QuantifiersEngine::getInstUserPatMode()
+{
+ if (options::userPatternsQuant() == options::UserPatMode::INTERLEAVE)
+ {
+ return d_ierCounter % 2 == 0 ? options::UserPatMode::USE
+ : options::UserPatMode::RESORT;
+ }
+ else
+ {
return options::userPatternsQuant();
}
}
/** get needs check */
bool getInstWhenNeedsCheck( Theory::Effort e );
/** get user pat mode */
- quantifiers::UserPatMode getInstUserPatMode();
-public:
+ options::UserPatMode getInstUserPatMode();
+
+ public:
/** add term to database */
void addTermToDatabase( Node n, bool withinQuant = false, bool withinInstClosure = false );
/** notification when master equality engine is updated */
#include "theory/rewriter.h"
-#include "theory/theory.h"
+#include "options/theory_options.h"
#include "smt/smt_engine_scope.h"
#include "smt/smt_statistics_registry.h"
#include "theory/rewriter_tables.h"
+#include "theory/theory.h"
#include "util/resource_manager.h"
using namespace std;
for( size_t i=0; i<n.getNumChildren(); i++ ){
bool processChild = true;
if( n.getKind()==kind::FORALL || n.getKind()==kind::EXISTS ){
- processChild = options::userPatternsQuant()==theory::quantifiers::USER_PAT_MODE_IGNORE ? i==1 : i>=1;
+ processChild =
+ options::userPatternsQuant() == options::UserPatMode::IGNORE
+ ? i == 1
+ : i >= 1;
}
if( processChild ){
children.push_back( n[i] );
for( size_t i=0; i<n.getNumChildren(); i++ ){
bool processChild = true;
if( n.getKind()==kind::FORALL || n.getKind()==kind::EXISTS ){
- processChild = options::userPatternsQuant()==theory::quantifiers::USER_PAT_MODE_IGNORE ? i==1 : i>=1;
+ processChild =
+ options::userPatternsQuant() == options::UserPatMode::IGNORE
+ ? i == 1
+ : i >= 1;
}
if( processChild ){
if( n.getKind()==kind::APPLY_UF ){
bool RegExpSolver::checkEqcIntersect(const std::vector<Node>& mems)
{
// do not compute intersections if the re intersection mode is none
- if (options::stringRegExpInterMode() == RE_INTER_NONE)
+ if (options::stringRegExpInterMode() == options::RegExpInterMode::NONE)
{
return true;
}
}
RegExpConstType rct = d_regexp_opr.getRegExpConstType(m[1]);
if (rct == RE_C_VARIABLE
- || (options::stringRegExpInterMode() == RE_INTER_CONSTANT
+ || (options::stringRegExpInterMode()
+ == options::RegExpInterMode::CONSTANT
&& rct != RE_C_CONRETE_CONSTANT))
{
// cannot do intersection on RE with variables, or with re.allchar based
// on option.
continue;
}
- if (options::stringRegExpInterMode() == RE_INTER_ONE_CONSTANT)
+ if (options::stringRegExpInterMode()
+ == options::RegExpInterMode::ONE_CONSTANT)
{
if (!mi.isNull() && rcti >= RE_C_CONSTANT && rct >= RE_C_CONSTANT)
{
// if both have re.allchar, do not do intersection if the
- // RE_INTER_ONE_CONSTANT option is set.
+ // options::RegExpInterMode::ONE_CONSTANT option is set.
continue;
}
}
Node SolverState::getPendingConflict() const { return d_pendingConflict; }
-std::pair<bool, Node> SolverState::entailmentCheck(TheoryOfMode mode, TNode lit)
+std::pair<bool, Node> SolverState::entailmentCheck(options::TheoryOfMode mode,
+ TNode lit)
{
return d_valuation.entailmentCheck(mode, lit);
}
#include "context/cdo.h"
#include "context/context.h"
#include "expr/node.h"
+#include "options/theory_options.h"
#include "theory/uf/equality_engine.h"
#include "theory/valuation.h"
*
* This calls entailmentCheck on the Valuation object of theory of strings.
*/
- std::pair<bool, Node> entailmentCheck(TheoryOfMode mode, TNode lit);
+ std::pair<bool, Node> entailmentCheck(options::TheoryOfMode mode, TNode lit);
/** Separate by length
*
* Separate the string representatives in argument n into a partition cols
#include "expr/kind.h"
#include "options/strings_options.h"
+#include "options/theory_options.h"
#include "smt/command.h"
#include "smt/logic_exception.h"
#include "smt/smt_statistics_registry.h"
Node lt2 = e==0 ? length_term_j : length_term_i;
Node ent_lit = Rewriter::rewrite( NodeManager::currentNM()->mkNode( kind::GT, lt1, lt2 ) );
std::pair<bool, Node> et = d_state.entailmentCheck(
- THEORY_OF_TYPE_BASED, ent_lit);
+ options::TheoryOfMode::THEORY_OF_TYPE_BASED, ent_lit);
if( et.first ){
Trace("strings-entail") << "Strings entailment : " << ent_lit << " is entailed in the current context." << std::endl;
Trace("strings-entail") << " explanation was : " << et.second << std::endl;
int index,
InferInfo& info)
{
- if (options::stringProcessLoopMode() == ProcessLoopMode::ABORT)
+ if (options::stringProcessLoopMode() == options::ProcessLoopMode::ABORT)
{
throw LogicException("Looping word equation encountered.");
}
- else if (options::stringProcessLoopMode() == ProcessLoopMode::NONE)
+ else if (options::stringProcessLoopMode() == options::ProcessLoopMode::NONE)
{
d_out->setIncomplete();
return ProcessLoopResult::SKIPPED;
}
else
{
- if (options::stringProcessLoopMode() == ProcessLoopMode::SIMPLE_ABORT)
+ if (options::stringProcessLoopMode()
+ == options::ProcessLoopMode::SIMPLE_ABORT)
{
throw LogicException("Normal looping word equation encountered.");
}
- else if (options::stringProcessLoopMode() == ProcessLoopMode::SIMPLE)
+ else if (options::stringProcessLoopMode()
+ == options::ProcessLoopMode::SIMPLE)
{
d_out->setIncomplete();
return ProcessLoopResult::SKIPPED;
#include "theory/theory.h"
-#include <vector>
-#include <sstream>
#include <iostream>
+#include <sstream>
#include <string>
+#include <vector>
#include "base/check.h"
#include "expr/node_algorithm.h"
+#include "options/theory_options.h"
#include "smt/smt_statistics_registry.h"
#include "theory/ext_theory.h"
#include "theory/quantifiers_engine.h"
delete d_extTheory;
}
-TheoryId Theory::theoryOf(TheoryOfMode mode, TNode node) {
+TheoryId Theory::theoryOf(options::TheoryOfMode mode, TNode node)
+{
TheoryId tid = THEORY_BUILTIN;
switch(mode) {
- case THEORY_OF_TYPE_BASED:
- // Constants, variables, 0-ary constructors
- if (node.isVar()) {
- if( node.getKind() == kind::BOOLEAN_TERM_VARIABLE ){
- tid = THEORY_UF;
- }else{
- tid = Theory::theoryOf(node.getType());
- }
- }else if (node.isConst()) {
- tid = Theory::theoryOf(node.getType());
- } else if (node.getKind() == kind::EQUAL) {
- // Equality is owned by the theory that owns the domain
- tid = Theory::theoryOf(node[0].getType());
- } else {
- // Regular nodes are owned by the kind
- tid = kindToTheoryId(node.getKind());
- }
- break;
- case THEORY_OF_TERM_BASED:
- // Variables
- if (node.isVar()) {
- if (Theory::theoryOf(node.getType()) != theory::THEORY_BOOL) {
- // We treat the variables as uninterpreted
- tid = s_uninterpretedSortOwner;
- } else {
- if( node.getKind() == kind::BOOLEAN_TERM_VARIABLE ){
- //Boolean vars go to UF
+ case options::TheoryOfMode::THEORY_OF_TYPE_BASED:
+ // Constants, variables, 0-ary constructors
+ if (node.isVar())
+ {
+ if (node.getKind() == kind::BOOLEAN_TERM_VARIABLE)
+ {
tid = THEORY_UF;
- }else{
- // Except for the Boolean ones
- tid = THEORY_BOOL;
}
+ else
+ {
+ tid = Theory::theoryOf(node.getType());
+ }
+ }
+ else if (node.isConst())
+ {
+ tid = Theory::theoryOf(node.getType());
}
- } else if (node.isConst()) {
- // Constants go to the theory of the type
- tid = Theory::theoryOf(node.getType());
- } else if (node.getKind() == kind::EQUAL) { // Equality
- // If one of them is an ITE, it's irelevant, since they will get replaced out anyhow
- if (node[0].getKind() == kind::ITE) {
+ else if (node.getKind() == kind::EQUAL)
+ {
+ // Equality is owned by the theory that owns the domain
tid = Theory::theoryOf(node[0].getType());
- } else if (node[1].getKind() == kind::ITE) {
- tid = Theory::theoryOf(node[1].getType());
- } else {
- TNode l = node[0];
- TNode r = node[1];
- TypeNode ltype = l.getType();
- TypeNode rtype = r.getType();
- if( ltype != rtype ){
- tid = Theory::theoryOf(l.getType());
- }else {
- // If both sides belong to the same theory the choice is easy
- TheoryId T1 = Theory::theoryOf(l);
- TheoryId T2 = Theory::theoryOf(r);
- if (T1 == T2) {
- tid = T1;
- } else {
- TheoryId T3 = Theory::theoryOf(ltype);
- // This is a case of
- // * x*y = f(z) -> UF
- // * x = c -> UF
- // * f(x) = read(a, y) -> either UF or ARRAY
- // at least one of the theories has to be parametric, i.e. theory of the type is different
- // from the theory of the term
- if (T1 == T3) {
- tid = T2;
- } else if (T2 == T3) {
+ }
+ else
+ {
+ // Regular nodes are owned by the kind
+ tid = kindToTheoryId(node.getKind());
+ }
+ break;
+ case options::TheoryOfMode::THEORY_OF_TERM_BASED:
+ // Variables
+ if (node.isVar())
+ {
+ if (Theory::theoryOf(node.getType()) != theory::THEORY_BOOL)
+ {
+ // We treat the variables as uninterpreted
+ tid = s_uninterpretedSortOwner;
+ }
+ else
+ {
+ if (node.getKind() == kind::BOOLEAN_TERM_VARIABLE)
+ {
+ // Boolean vars go to UF
+ tid = THEORY_UF;
+ }
+ else
+ {
+ // Except for the Boolean ones
+ tid = THEORY_BOOL;
+ }
+ }
+ }
+ else if (node.isConst())
+ {
+ // Constants go to the theory of the type
+ tid = Theory::theoryOf(node.getType());
+ }
+ else if (node.getKind() == kind::EQUAL)
+ { // Equality
+ // If one of them is an ITE, it's irelevant, since they will get
+ // replaced out anyhow
+ if (node[0].getKind() == kind::ITE)
+ {
+ tid = Theory::theoryOf(node[0].getType());
+ }
+ else if (node[1].getKind() == kind::ITE)
+ {
+ tid = Theory::theoryOf(node[1].getType());
+ }
+ else
+ {
+ TNode l = node[0];
+ TNode r = node[1];
+ TypeNode ltype = l.getType();
+ TypeNode rtype = r.getType();
+ if (ltype != rtype)
+ {
+ tid = Theory::theoryOf(l.getType());
+ }
+ else
+ {
+ // If both sides belong to the same theory the choice is easy
+ TheoryId T1 = Theory::theoryOf(l);
+ TheoryId T2 = Theory::theoryOf(r);
+ if (T1 == T2)
+ {
tid = T1;
- } else {
- // If both are parametric, we take the smaller one (arbitrary)
- tid = T1 < T2 ? T1 : T2;
+ }
+ else
+ {
+ TheoryId T3 = Theory::theoryOf(ltype);
+ // This is a case of
+ // * x*y = f(z) -> UF
+ // * x = c -> UF
+ // * f(x) = read(a, y) -> either UF or ARRAY
+ // at least one of the theories has to be parametric, i.e. theory
+ // of the type is different from the theory of the term
+ if (T1 == T3)
+ {
+ tid = T2;
+ }
+ else if (T2 == T3)
+ {
+ tid = T1;
+ }
+ else
+ {
+ // If both are parametric, we take the smaller one (arbitrary)
+ tid = T1 < T2 ? T1 : T2;
+ }
}
}
}
}
- } else {
- // Regular nodes are owned by the kind
- tid = kindToTheoryId(node.getKind());
- }
+ else
+ {
+ // Regular nodes are owned by the kind
+ tid = kindToTheoryId(node.getKind());
+ }
break;
default:
Unreachable();
#include "lib/ffs.h"
#include "options/options.h"
#include "options/theory_options.h"
-#include "options/theoryof_mode.h"
#include "smt/command.h"
#include "smt/dump.h"
#include "smt/logic_request.h"
/**
* Returns the ID of the theory responsible for the given node.
*/
- static TheoryId theoryOf(TheoryOfMode mode, TNode node);
+ static TheoryId theoryOf(options::TheoryOfMode mode, TNode node);
/**
* Returns the ID of the theory responsible for the given node.
#include "options/options.h"
#include "options/proof_options.h"
#include "options/quantifiers_options.h"
+#include "options/theory_options.h"
#include "preprocessing/assertion_pipeline.h"
#include "proof/cnf_proof.h"
#include "proof/lemma_proof.h"
const std::vector<Node>& assertions)
{
bool useSlicer = true;
- if (options::bitvectorEqualitySlicer() == bv::BITVECTOR_SLICER_ON)
+ if (options::bitvectorEqualitySlicer() == options::BvSlicerMode::ON)
{
if (!d_logicInfo.isPure(theory::THEORY_BV) || d_logicInfo.isQuantified())
throw ModalException(
"Slicer does not currently support model generation. Use "
"--bv-eq-slicer=off");
}
- else if (options::bitvectorEqualitySlicer() == bv::BITVECTOR_SLICER_OFF)
+ else if (options::bitvectorEqualitySlicer() == options::BvSlicerMode::OFF)
{
return;
}
- else if (options::bitvectorEqualitySlicer() == bv::BITVECTOR_SLICER_AUTO)
+ else if (options::bitvectorEqualitySlicer() == options::BvSlicerMode::AUTO)
{
if ((!d_logicInfo.isPure(theory::THEORY_BV) || d_logicInfo.isQuantified())
|| options::incrementalSolving()
}
}
-std::pair<bool, Node> TheoryEngine::entailmentCheck(theory::TheoryOfMode mode, TNode lit, const EntailmentCheckParameters* params, EntailmentCheckSideEffects* seffects) {
+std::pair<bool, Node> TheoryEngine::entailmentCheck(
+ options::TheoryOfMode mode,
+ TNode lit,
+ const EntailmentCheckParameters* params,
+ EntailmentCheckSideEffects* seffects)
+{
TNode atom = (lit.getKind() == kind::NOT) ? lit[0] : lit;
if( atom.getKind()==kind::AND || atom.getKind()==kind::OR || atom.getKind()==kind::IMPLIES ){
//Boolean connective, recurse
#include <memory>
#include <set>
#include <unordered_map>
-#include <vector>
#include <utility>
+#include <vector>
#include "base/check.h"
#include "context/cdhashset.h"
#include "expr/node.h"
#include "options/options.h"
#include "options/smt_options.h"
+#include "options/theory_options.h"
#include "prop/prop_engine.h"
#include "smt/command.h"
#include "smt_util/lemma_channels.h"
* Forwards an entailment check according to the given theoryOfMode.
* See theory.h for documentation on entailmentCheck().
*/
- std::pair<bool, Node> entailmentCheck(theory::TheoryOfMode mode, TNode lit, const theory::EntailmentCheckParameters* params = NULL, theory::EntailmentCheckSideEffects* out = NULL);
-
-private:
+ std::pair<bool, Node> entailmentCheck(
+ options::TheoryOfMode mode,
+ TNode lit,
+ const theory::EntailmentCheckParameters* params = NULL,
+ theory::EntailmentCheckSideEffects* out = NULL);
+ private:
/** Default visitor for pre-registration */
PreRegisterVisitor d_preRegistrationVisitor;
}
Unreachable();
${mk_type_enumerator_cases}
-#line 44 "${template}"
+#line 46 "${template}"
default: Unhandled() << "No type enumerator for type `" << type << "'";
}
Unreachable();
{
d_cardinality_term = n;
- if (options::ufssMode() == UF_SS_FULL)
+ if (options::ufssMode() == options::UfssMode::FULL)
{
// Register the strategy with the decision manager of the theory.
// We are guaranteed that the decision manager is ready since we
/** check */
void SortModel::check( Theory::Effort level, OutputChannel* out ){
- Assert(options::ufssMode() == UF_SS_FULL);
+ Assert(options::ufssMode() == options::UfssMode::FULL);
if( level>=Theory::EFFORT_STANDARD && d_hasCard && !d_conflict ){
Debug("uf-ss") << "CardinalityExtension: Check " << level << " " << d_type
<< std::endl;
d_min_pos_tn_master_card(c, -1),
d_rel_eqc(c)
{
- if (options::ufssMode() == UF_SS_FULL && options::ufssFairness())
+ if (options::ufssMode() == options::UfssMode::FULL && options::ufssFairness())
{
// Register the strategy with the decision manager of the theory.
// We are guaranteed that the decision manager is ready since we
#endif
bool polarity = n.getKind() != kind::NOT;
TNode lit = polarity ? n : n[0];
- if( options::ufssMode()==UF_SS_FULL ){
+ if (options::ufssMode() == options::UfssMode::FULL)
+ {
if( lit.getKind()==CARDINALITY_CONSTRAINT ){
TypeNode tn = lit[0].getType();
Assert(tn.isSort());
}
}
}
- }else{
+ }
+ else
+ {
if( lit.getKind()==CARDINALITY_CONSTRAINT || lit.getKind()==COMBINED_CARDINALITY_CONSTRAINT ){
// cardinality constraint from user input, set incomplete
Trace("uf-ss") << "Literal " << lit << " not handled when uf ss mode is not FULL, set incomplete." << std::endl;
void CardinalityExtension::check(Theory::Effort level)
{
if( !d_conflict ){
- if( options::ufssMode()==UF_SS_FULL ){
+ if (options::ufssMode() == options::UfssMode::FULL)
+ {
Trace("uf-ss-solver")
<< "CardinalityExtension: check " << level << std::endl;
if (level == Theory::EFFORT_FULL)
break;
}
}
- }else if( options::ufssMode()==UF_SS_NO_MINIMAL ){
+ }
+ else if (options::ufssMode() == options::UfssMode::NO_MINIMAL)
+ {
if( level==Theory::EFFORT_FULL ){
// split on an equality between two equivalence classes (at most one per type)
std::map< TypeNode, std::vector< Node > > eqc_list;
++eqcs_i;
}
}
- }else{
+ }
+ else
+ {
// unhandled uf ss mode
Assert(false);
}
void CardinalityExtension::preRegisterTerm(TNode n)
{
- if( options::ufssMode()==UF_SS_FULL ){
+ if (options::ufssMode() == options::UfssMode::FULL)
+ {
//initialize combined cardinality
initializeCombinedCardinality();
/** check */
void CardinalityExtension::checkCombinedCardinality()
{
- Assert(options::ufssMode() == UF_SS_FULL);
+ Assert(options::ufssMode() == options::UfssMode::FULL);
if( options::ufssFairness() ){
Trace("uf-ss-com-card-debug") << "Check combined cardinality, get maximum negative cardinalities..." << std::endl;
int totalCombinedCard = 0;
// finite model finding is enabled, and it is not disabled by
// options::ufssMode().
if (getLogicInfo().isTheoryEnabled(THEORY_UF) && options::finiteModelFind()
- && options::ufssMode() != UF_SS_NONE)
+ && options::ufssMode() != options::UfssMode::NONE)
{
d_thss.reset(new CardinalityExtension(
getSatContext(), getUserContext(), *d_out, this));
** Implementation of Valuation class.
**/
-#include "expr/node.h"
#include "theory/valuation.h"
-#include "theory/theory_engine.h"
+
+#include "expr/node.h"
+#include "options/theory_options.h"
#include "theory/rewriter.h"
+#include "theory/theory_engine.h"
namespace CVC4 {
namespace theory {
return d_engine->getPropEngine()->getAssertionLevel();
}
-std::pair<bool, Node> Valuation::entailmentCheck(theory::TheoryOfMode mode, TNode lit, const theory::EntailmentCheckParameters* params, theory::EntailmentCheckSideEffects* out) {
+std::pair<bool, Node> Valuation::entailmentCheck(
+ options::TheoryOfMode mode,
+ TNode lit,
+ const theory::EntailmentCheckParameters* params,
+ theory::EntailmentCheckSideEffects* out)
+{
return d_engine->entailmentCheck(mode, lit, params, out);
}
#define CVC4__THEORY__VALUATION_H
#include "expr/node.h"
-#include "options/theoryof_mode.h"
+#include "options/theory_options.h"
namespace CVC4 {
* Request an entailment check according to the given theoryOfMode.
* See theory.h for documentation on entailmentCheck().
*/
- std::pair<bool, Node> entailmentCheck(theory::TheoryOfMode mode, TNode lit, const theory::EntailmentCheckParameters* params = NULL, theory::EntailmentCheckSideEffects* out = NULL);
+ std::pair<bool, Node> entailmentCheck(
+ options::TheoryOfMode mode,
+ TNode lit,
+ const theory::EntailmentCheckParameters* params = NULL,
+ theory::EntailmentCheckSideEffects* out = NULL);
/** need check ? */
bool needCheck() const;