summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers/sygus_sampler.cpp
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2018-07-09 16:26:01 -0700
committerAndres Noetzli <andres.noetzli@gmail.com>2018-07-13 17:39:52 -0700
commit0631bbb1716dc7343cfb0c3a4b447c7e667dc5d2 (patch)
tree660f2fa6e70991d004c80c6eace2cd043a98bae3 /src/theory/quantifiers/sygus_sampler.cpp
parent86d9ba4431108e1fd89639e23857631a7380a005 (diff)
Add floating-point support in evaluatoreval_fp
Currently, the operations implemented by the FloatingPoint class are fairly slow, so it is not always beneficial to use the Evaluator as opposed to the rewriter because the rewriter does more aggressive caching. Thus, the evaluator is disabled by default for floating-point logics. Note that this commit also adds a check for the --sygus-eval-opt flag in SygusSampler::evaluate() (previously, it was always used in that method).
Diffstat (limited to 'src/theory/quantifiers/sygus_sampler.cpp')
-rw-r--r--src/theory/quantifiers/sygus_sampler.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/theory/quantifiers/sygus_sampler.cpp b/src/theory/quantifiers/sygus_sampler.cpp
index b1b21a53e..0ed7cea12 100644
--- a/src/theory/quantifiers/sygus_sampler.cpp
+++ b/src/theory/quantifiers/sygus_sampler.cpp
@@ -451,16 +451,23 @@ void SygusSampler::addSamplePoint(std::vector<Node>& pt)
Node SygusSampler::evaluate(Node n, unsigned index)
{
Assert(index < d_samples.size());
- // use efficient rewrite for substitution + rewrite
- Node ev = d_eval.eval(n, d_vars, d_samples[index]);
- Trace("sygus-sample-ev") << "Evaluate ( " << n << ", " << index << " ) -> ";
- if (!ev.isNull())
+
+ std::vector<Node>& pt = d_samples[index];
+
+ Node ev;
+ if (options::sygusEvalOpt())
{
- Trace("sygus-sample-ev") << ev << std::endl;
- return ev;
+ // use efficient rewrite for substitution + rewrite
+ ev = d_eval.eval(n, d_vars, pt);
+ Trace("sygus-sample-ev") << "Evaluate ( " << n << ", " << index << " ) -> ";
+ if (!ev.isNull())
+ {
+ Trace("sygus-sample-ev") << ev << std::endl;
+ return ev;
+ }
}
+
// substitution + rewrite
- std::vector<Node>& pt = d_samples[index];
ev = n.substitute(d_vars.begin(), d_vars.end(), pt.begin(), pt.end());
ev = Rewriter::rewrite(ev);
Trace("sygus-sample-ev") << ev << std::endl;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback