diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2018-09-14 22:15:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-14 22:15:37 -0700 |
commit | 2060f439c873c8b1928cbd5f54967571176f2aba (patch) | |
tree | 45fab904b632b6174ee66807081465693a5da83f /src/preprocessing/passes/apply_substs.cpp | |
parent | c2111c86973b8a80e20a3fdf3cbd0b2ff0dc7010 (diff) |
Refactor how assertions are added to decision engine (#2396)
Before refactoring the preprocessing passes, we were using three
arguments to add assertions to the decision engine. Now all that
information lives in the AssertionPipeline. This commit moves the
AssertionPipeline to its own file and changes the `addAssertions()`
methods related to the decision engine to take an AssertionPipeline as
an arguement instead of three separate ones. Additionally, the
TheoryEngine now uses an AssertionPipeline for lemmas.
Diffstat (limited to 'src/preprocessing/passes/apply_substs.cpp')
-rw-r--r-- | src/preprocessing/passes/apply_substs.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/preprocessing/passes/apply_substs.cpp b/src/preprocessing/passes/apply_substs.cpp index 6fb4b7793..f5c3520d0 100644 --- a/src/preprocessing/passes/apply_substs.cpp +++ b/src/preprocessing/passes/apply_substs.cpp @@ -44,8 +44,9 @@ PreprocessingPassResult ApplySubsts::applyInternal( // When solving incrementally, all substitutions are piled into the // assertion at d_substitutionsIndex: we don't want to apply substitutions // to this assertion or information will be lost. - context::CDO<unsigned>& substs_index = - assertionsToPreprocess->getSubstitutionsIndex(); + unsigned substs_index = d_preprocContext->getSubstitutionsIndex(); + theory::SubstitutionMap& substMap = + d_preprocContext->getTopLevelSubstitutions(); unsigned size = assertionsToPreprocess->size(); unsigned substitutionAssertion = substs_index > 0 ? substs_index : size; for (unsigned i = 0; i < size; ++i) @@ -57,11 +58,9 @@ PreprocessingPassResult ApplySubsts::applyInternal( Trace("apply-substs") << "applying to " << (*assertionsToPreprocess)[i] << std::endl; d_preprocContext->spendResource(options::preprocessStep()); - assertionsToPreprocess->replace( - i, - theory::Rewriter::rewrite( - assertionsToPreprocess->getTopLevelSubstitutions().apply( - (*assertionsToPreprocess)[i]))); + assertionsToPreprocess->replace(i, + theory::Rewriter::rewrite(substMap.apply( + (*assertionsToPreprocess)[i]))); Trace("apply-substs") << " got " << (*assertionsToPreprocess)[i] << std::endl; } |