#include "options/arith_options.h"
#include "options/smt_options.h"
-#include "printer/smt2/smt2_printer.h"
-#include "smt/logic_exception.h"
#include "theory/arith/arith_state.h"
#include "theory/arith/arith_utilities.h"
#include "theory/arith/bound_inference.h"
// register terms with extended theory, to find extended terms that can be
// eliminated by context-depedendent simplification.
d_extTheory.registerTerm(n);
- // logic exceptions based on the configuration of nl-ext: if we are a
- // transcendental function, we require nl-ext=full.
- Kind k = n.getKind();
- if (isTranscendentalKind(k))
- {
- if (options().arith.nlExt != options::NlExtMode::FULL)
- {
- std::stringstream ss;
- ss << "Term of kind " << printer::smt2::Smt2Printer::smtKindString(k)
- << " requires nl-ext mode to be set to value 'full'";
- throw LogicException(ss.str());
- }
- }
- if (isTranscendentalKind(k) || k == Kind::IAND || k == Kind::POW2)
- {
- if (options().arith.nlCov && !options().arith.nlCovForce)
- {
- std::stringstream ss;
- ss << "Term of kind " << printer::smt2::Smt2Printer::smtKindString(k)
- << " is not compatible with using the coverings-based solver. If you know what you are doing, "
- "you can try --nl-cov-force, but expect crashes or incorrect results.";
- throw LogicException(ss.str());
- }
- }
}
void NonlinearExtension::processSideEffect(const NlLemma& se)
#include "theory/arith/theory_arith.h"
#include "options/smt_options.h"
+#include "printer/smt2/smt2_printer.h"
#include "proof/proof_checker.h"
#include "proof/proof_rule.h"
+#include "smt/logic_exception.h"
#include "smt/smt_statistics_registry.h"
#include "theory/arith/arith_evaluator.h"
#include "theory/arith/arith_rewriter.h"
#include "theory/arith/equality_solver.h"
-#include "theory/arith/nl/nonlinear_extension.h"
#include "theory/arith/linear/theory_arith_private.h"
+#include "theory/arith/nl/nonlinear_extension.h"
#include "theory/ext_theory.h"
#include "theory/rewriter.h"
#include "theory/theory_model.h"
void TheoryArith::preRegisterTerm(TNode n)
{
+ // handle logic exceptions
+ Kind k = n.getKind();
+ bool isTransKind = isTranscendentalKind(k);
+ // note that we don't throw an exception for non-linear multiplication in
+ // linear logics, since this is caught in the linear solver with a more
+ // informative error message
+ if (isTransKind || k == IAND || k == POW2)
+ {
+ if (d_nonlinearExtension == nullptr)
+ {
+ std::stringstream ss;
+ ss << "Term of kind " << printer::smt2::Smt2Printer::smtKindString(k)
+ << " requires the logic to include non-linear arithmetic";
+ throw LogicException(ss.str());
+ }
+ // logic exceptions based on the configuration of nl-ext: if we are a
+ // transcendental function, we require nl-ext=full.
+ if (isTransKind)
+ {
+ if (options().arith.nlExt != options::NlExtMode::FULL)
+ {
+ std::stringstream ss;
+ ss << "Term of kind " << printer::smt2::Smt2Printer::smtKindString(k)
+ << " requires nl-ext mode to be set to value 'full'";
+ throw LogicException(ss.str());
+ }
+ }
+ if (options().arith.nlCov && !options().arith.nlCovForce)
+ {
+ std::stringstream ss;
+ ss << "Term of kind " << printer::smt2::Smt2Printer::smtKindString(k)
+ << " is not compatible with using the coverings-based solver. If "
+ "you know what you are doing, "
+ "you can try --nl-cov-force, but expect crashes or incorrect "
+ "results.";
+ throw LogicException(ss.str());
+ }
+ }
if (d_nonlinearExtension != nullptr)
{
d_nonlinearExtension->preRegisterTerm(n);