Skip to content

Commit 7c894e7

Browse files
author
Daniel Kroening
authored
Merge pull request diffblue#2402 from tautschnig/vs-no-dummy
Remove dummy implementations from propt
2 parents 822de57 + 82c7e48 commit 7c894e7

File tree

5 files changed

+33
-26
lines changed

5 files changed

+33
-26
lines changed

src/solvers/prop/prop.cpp

-19
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,13 @@ Author: Daniel Kroening, [email protected]
88

99
#include "prop.h"
1010

11-
#include <cassert>
12-
1311
/// asserts a==b in the propositional formula
1412
void propt::set_equal(literalt a, literalt b)
1513
{
1614
lcnf(a, !b);
1715
lcnf(!a, b);
1816
}
1917

20-
void propt::set_assignment(literalt a, bool value)
21-
{
22-
assert(false);
23-
}
24-
25-
void propt::copy_assignment_from(const propt &src)
26-
{
27-
assert(false);
28-
}
29-
30-
/// \return true iff the given literal is part of the final conflict
31-
bool propt::is_in_conflict(literalt l) const
32-
{
33-
assert(false);
34-
return false;
35-
}
36-
3718
/// generates a bitvector of given width with new variables
3819
/// \return bitvector
3920
bvt propt::new_variables(std::size_t width)

src/solvers/prop/prop.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ class propt:public messaget
9898

9999
// satisfying assignment
100100
virtual tvt l_get(literalt a) const=0;
101-
virtual void set_assignment(literalt a, bool value);
102-
virtual void copy_assignment_from(const propt &prop);
101+
virtual void set_assignment(literalt a, bool value) = 0;
103102

104-
// Returns true if an assumption is in the final conflict.
105-
// Note that only literals that are assumptions (see set_assumptions)
106-
// may be queried.
107-
virtual bool is_in_conflict(literalt l) const;
103+
/// Returns true if an assumption is in the final conflict.
104+
/// Note that only literals that are assumptions (see set_assumptions)
105+
/// may be queried.
106+
/// \return true iff the given literal is part of the final conflict
107+
virtual bool is_in_conflict(literalt l) const = 0;
108108
virtual bool has_is_in_conflict() const { return false; }
109109

110110
// an incremental solver may remove any variables that aren't frozen

src/solvers/sat/dimacs_cnf.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Author: Daniel Kroening, [email protected]
99

1010
#include "dimacs_cnf.h"
1111

12+
#include <util/invariant.h>
1213
#include <util/magic.h>
1314

1415
#include <iostream>
@@ -18,6 +19,17 @@ dimacs_cnft::dimacs_cnft():break_lines(false)
1819
{
1920
}
2021

22+
void dimacs_cnft::set_assignment(literalt a, bool value)
23+
{
24+
UNIMPLEMENTED;
25+
}
26+
27+
bool dimacs_cnft::is_in_conflict(literalt l) const
28+
{
29+
UNREACHABLE;
30+
return false;
31+
}
32+
2133
dimacs_cnf_dumpt::dimacs_cnf_dumpt(std::ostream &_out):out(_out)
2234
{
2335
}

src/solvers/sat/dimacs_cnf.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ class dimacs_cnft:public cnf_clause_listt
2424

2525
// dummy functions
2626

27-
virtual const std::string solver_text()
27+
const std::string solver_text() override
2828
{
2929
return "DIMACS CNF";
3030
}
3131

32+
void set_assignment(literalt a, bool value) override;
33+
bool is_in_conflict(literalt l) const override;
34+
3235
protected:
3336
void write_problem_line(std::ostream &out);
3437
void write_clauses(std::ostream &out);

unit/miniBDD_new.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,17 @@ class bdd_propt:public propt
163163

164164
bool has_set_to() const override { return false; }
165165
bool cnf_handled_well() const override { return false; }
166+
167+
void set_assignment(literalt, bool) override
168+
{
169+
UNIMPLEMENTED;
170+
}
171+
172+
bool is_in_conflict(literalt) const override
173+
{
174+
UNREACHABLE;
175+
return false;
176+
}
166177
};
167178

168179
SCENARIO("miniBDD", "[core][solver][miniBDD]")

0 commit comments

Comments
 (0)