From a1b73df93e5a2fac4a7ac87fb1753c4eb518c8c0 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Wed, 27 Mar 2019 11:33:07 +0000 Subject: Separate constraint set and constraint manager --- lib/Solver/MetaSMTSolver.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'lib/Solver/MetaSMTSolver.cpp') diff --git a/lib/Solver/MetaSMTSolver.cpp b/lib/Solver/MetaSMTSolver.cpp index fbb7da61..0f78bb5b 100644 --- a/lib/Solver/MetaSMTSolver.cpp +++ b/lib/Solver/MetaSMTSolver.cpp @@ -225,11 +225,9 @@ SolverImpl::SolverRunStatus MetaSMTSolverImpl::runAndGetCex( std::vector > &values, bool &hasSolution) { // assume the constraints of the query - for (ConstraintManager::const_iterator it = query.constraints.begin(), - ie = query.constraints.end(); - it != ie; ++it) { - assumption(_meta_solver, _builder->construct(*it)); - } + for (auto &constraint : query.constraints) + assumption(_meta_solver, _builder->construct(constraint)); + // assume the negation of the query assumption(_meta_solver, _builder->construct(Expr::createIsZero(query.expr))); hasSolution = solve(_meta_solver); @@ -303,10 +301,8 @@ MetaSMTSolverImpl::runAndGetCexForked( } // assert constraints as we are in a child process - for (ConstraintManager::const_iterator it = query.constraints.begin(), - ie = query.constraints.end(); - it != ie; ++it) { - assertion(_meta_solver, _builder->construct(*it)); + for (const auto &constraint : query.constraints) { + assertion(_meta_solver, _builder->construct(constraint)); // assumption(_meta_solver, _builder->construct(*it)); } -- cgit 1.4.1