summaryrefslogtreecommitdiff
path: root/src/theory/arith/nl/nonlinear_extension.cpp
diff options
context:
space:
mode:
authoryoni206 <yoni206@users.noreply.github.com>2021-06-25 19:42:43 -0700
committerGitHub <noreply@github.com>2021-06-25 19:42:43 -0700
commiteefd31d2fe256bdee9a5c33105eced1a358bb378 (patch)
tree5b8d52bdfc288557bf6456ca315ad2862ab4669b /src/theory/arith/nl/nonlinear_extension.cpp
parentabd18eeb854047e13e38518c536afd16a1be448d (diff)
pow2 -- final changes (#6800)
This commit adds the remaining changes for a working and integrated `pow2` solver. In particular, it adds a rewrite and a lemma that identify `pow2(x)` with `0` whenever `x<0`. Regressions are added as well, including `pow2-native-0.smt2` that shows the semantics of `pow2` on negative values. The next steps are new rewrites and and more lemma schemas.
Diffstat (limited to 'src/theory/arith/nl/nonlinear_extension.cpp')
-rw-r--r--src/theory/arith/nl/nonlinear_extension.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/theory/arith/nl/nonlinear_extension.cpp b/src/theory/arith/nl/nonlinear_extension.cpp
index 1bb558d1b..a8b056d45 100644
--- a/src/theory/arith/nl/nonlinear_extension.cpp
+++ b/src/theory/arith/nl/nonlinear_extension.cpp
@@ -59,13 +59,15 @@ NonlinearExtension::NonlinearExtension(TheoryArith& containing,
d_tangentPlaneSlv(&d_extState),
d_cadSlv(d_im, d_model, state.getUserContext(), pnm),
d_icpSlv(d_im),
- d_iandSlv(d_im, state, d_model)
+ d_iandSlv(d_im, state, d_model),
+ d_pow2Slv(d_im, state, d_model)
{
d_extTheory.addFunctionKind(kind::NONLINEAR_MULT);
d_extTheory.addFunctionKind(kind::EXPONENTIAL);
d_extTheory.addFunctionKind(kind::SINE);
d_extTheory.addFunctionKind(kind::PI);
d_extTheory.addFunctionKind(kind::IAND);
+ d_extTheory.addFunctionKind(kind::POW2);
d_true = NodeManager::currentNM()->mkConst(true);
d_zero = NodeManager::currentNM()->mkConst(Rational(0));
d_one = NodeManager::currentNM()->mkConst(Rational(1));
@@ -568,6 +570,11 @@ void NonlinearExtension::runStrategy(Theory::Effort effort,
break;
case InferStep::IAND_FULL: d_iandSlv.checkFullRefine(); break;
case InferStep::IAND_INITIAL: d_iandSlv.checkInitialRefine(); break;
+ case InferStep::POW2_INIT:
+ d_pow2Slv.initLastCall(assertions, false_asserts, xts);
+ break;
+ case InferStep::POW2_FULL: d_pow2Slv.checkFullRefine(); break;
+ case InferStep::POW2_INITIAL: d_pow2Slv.checkInitialRefine(); break;
case InferStep::ICP:
d_icpSlv.reset(assertions);
d_icpSlv.check();
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback