Skip to content

Commit

Permalink
Remove unnecessary includes from minisat component
Browse files Browse the repository at this point in the history
  • Loading branch information
blishko committed Aug 7, 2024
1 parent 17c6040 commit 8a15f5d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
11 changes: 3 additions & 8 deletions src/minisat/core/SolverTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
#ifndef Minisat_SolverTypes_h
#define Minisat_SolverTypes_h

#include <assert.h>

#include "osmtinttypes.h"
#include "Alg.h"
#include "Vec.h"
#include "Map.h"
#include "Alloc.h"
#include "TypeUtils.h"


#include <cassert>
//=================================================================================================
// Variables, literals, lifted booleans, clauses:

Expand Down Expand Up @@ -234,10 +230,9 @@ class ClauseAllocator : public RegionAllocator<uint32_t>
RegionAllocator<uint32_t>::moveTo(to); }

template<class Lits>
CRef alloc(const Lits& ps, opensmt::pair<bool,uint32_t> learntAndGlue = {false, 0}) {
CRef alloc(const Lits& ps, bool learnt = false, uint32_t glue = 0) {
assert(sizeof(Lit) == sizeof(uint32_t));
assert(sizeof(float) == sizeof(uint32_t));
auto [learnt, glue] = learntAndGlue;
bool use_extra = learnt | extra_clause_field;

CRef cid = RegionAllocator<uint32_t>::alloc(clauseWord32Size(ps.size(), use_extra));
Expand Down Expand Up @@ -267,7 +262,7 @@ class ClauseAllocator : public RegionAllocator<uint32_t>

if (c.reloced()) { cr = c.relocation(); return; }

cr = to.alloc(c, {c.learnt(), c.getGlue()});
cr = to.alloc(c, c.learnt(), c.getGlue());
c.relocate(cr);

// Copy extra data-fields:
Expand Down
6 changes: 3 additions & 3 deletions src/smtsolvers/CoreSMTSolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ void CoreSMTSolver::analyze(CRef confl, vec<Lit>& out_learnt, int& out_btlevel)
}
else
{
ctr = config.sat_temporary_learn ? ca.alloc(r, {true, computeGlue(r)}) : ca.alloc(r);
ctr = config.sat_temporary_learn ? ca.alloc(r, true, computeGlue(r)) : ca.alloc(r);
learnts.push(ctr);
attachClause(ctr);
undo_stack.push(undo_stack_el(undo_stack_el::NEWLEARNT, ctr));
Expand Down Expand Up @@ -860,7 +860,7 @@ bool CoreSMTSolver::litRedundant(Lit p, uint32_t abstract_levels)
}
else
{
ct = config.sat_temporary_learn ? ca.alloc(r, {true, computeGlue(r)}) : ca.alloc(r);
ct = config.sat_temporary_learn ? ca.alloc(r, true, computeGlue(r)) : ca.alloc(r);
learnts.push(ct);
if (config.isIncremental() != 0)
undo_stack.push(undo_stack_el(undo_stack_el::NEWLEARNT, ct));
Expand Down Expand Up @@ -1477,7 +1477,7 @@ lbool CoreSMTSolver::search(int nof_conflicts)
learnts_size += learnt_clause.size( );
all_learnts ++;

CRef cr = ca.alloc(learnt_clause, {true, computeGlue(learnt_clause)});
CRef cr = ca.alloc(learnt_clause, true, computeGlue(learnt_clause));

if (logsResolutionProof()) {
resolutionProof->endChain(cr);
Expand Down
2 changes: 1 addition & 1 deletion src/smtsolvers/LookaheadSMTSolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ lbool LookaheadSMTSolver::laPropagateWrapper() {
if (logsResolutionProof()) { resolutionProof->endChain(unitClause); }
uncheckedEnqueue(out_learnt[0], unitClause);
} else {
CRef crd = ca.alloc(out_learnt, {true, computeGlue(out_learnt)});
CRef crd = ca.alloc(out_learnt, true, computeGlue(out_learnt));
if (logsResolutionProof()) { resolutionProof->endChain(crd); }
learnts.push(crd);
attachClause(crd);
Expand Down
6 changes: 3 additions & 3 deletions src/smtsolvers/TheoryIF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ CoreSMTSolver::handleUnsat()
{
if (logsResolutionProof()) {
// All conflicting atoms are dec-level 0
CRef confl = config.sat_temporary_learn ? ca.alloc(conflicting, {true, computeGlue(conflicting)}) : ca.alloc(conflicting);
CRef confl = config.sat_temporary_learn ? ca.alloc(conflicting, true, computeGlue(conflicting)) : ca.alloc(conflicting);
resolutionProof->newTheoryClause(confl);
this->finalizeResolutionProof(confl);
}
Expand All @@ -253,7 +253,7 @@ CoreSMTSolver::handleUnsat()
}
// Learn theory lemma
else {
confl = config.sat_temporary_learn ? ca.alloc(conflicting, {true, computeGlue(conflicting)}) : ca.alloc(conflicting);
confl = config.sat_temporary_learn ? ca.alloc(conflicting, true, computeGlue(conflicting)) : ca.alloc(conflicting);
learnts.push(confl);
attachClause(confl);
claBumpActivity(ca[confl]);
Expand Down Expand Up @@ -294,7 +294,7 @@ CoreSMTSolver::handleUnsat()
learnts_size += learnt_clause.size( );
all_learnts ++;

CRef cr = ca.alloc(learnt_clause, {true, computeGlue(learnt_clause)});
CRef cr = ca.alloc(learnt_clause, true, computeGlue(learnt_clause));

if (logsResolutionProof()) {
resolutionProof->endChain(cr);
Expand Down

0 comments on commit 8a15f5d

Please sign in to comment.