Skip to content

Remove dummy implementations from propt #2402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions src/solvers/prop/prop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,13 @@ Author: Daniel Kroening, [email protected]

#include "prop.h"

#include <cassert>

/// asserts a==b in the propositional formula
void propt::set_equal(literalt a, literalt b)
{
lcnf(a, !b);
lcnf(!a, b);
}

void propt::set_assignment(literalt a, bool value)
{
assert(false);
}

void propt::copy_assignment_from(const propt &src)
{
assert(false);
}

/// \return true iff the given literal is part of the final conflict
bool propt::is_in_conflict(literalt l) const
{
assert(false);
return false;
}

/// generates a bitvector of given width with new variables
/// \return bitvector
bvt propt::new_variables(std::size_t width)
Expand Down
12 changes: 6 additions & 6 deletions src/solvers/prop/prop.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ class propt:public messaget

// satisfying assignment
virtual tvt l_get(literalt a) const=0;
virtual void set_assignment(literalt a, bool value);
virtual void copy_assignment_from(const propt &prop);
virtual void set_assignment(literalt a, bool value) = 0;

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

// an incremental solver may remove any variables that aren't frozen
Expand Down
12 changes: 12 additions & 0 deletions src/solvers/sat/dimacs_cnf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Author: Daniel Kroening, [email protected]

#include "dimacs_cnf.h"

#include <util/invariant.h>
#include <util/magic.h>

#include <iostream>
Expand All @@ -18,6 +19,17 @@ dimacs_cnft::dimacs_cnft():break_lines(false)
{
}

void dimacs_cnft::set_assignment(literalt a, bool value)
{
UNIMPLEMENTED;
}

bool dimacs_cnft::is_in_conflict(literalt l) const
{
UNREACHABLE;
return false;
}

dimacs_cnf_dumpt::dimacs_cnf_dumpt(std::ostream &_out):out(_out)
{
}
Expand Down
5 changes: 4 additions & 1 deletion src/solvers/sat/dimacs_cnf.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ class dimacs_cnft:public cnf_clause_listt

// dummy functions

virtual const std::string solver_text()
const std::string solver_text() override
{
return "DIMACS CNF";
}

void set_assignment(literalt a, bool value) override;
bool is_in_conflict(literalt l) const override;

protected:
void write_problem_line(std::ostream &out);
void write_clauses(std::ostream &out);
Expand Down
11 changes: 11 additions & 0 deletions unit/miniBDD_new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,17 @@ class bdd_propt:public propt

bool has_set_to() const override { return false; }
bool cnf_handled_well() const override { return false; }

void set_assignment(literalt, bool) override
{
UNIMPLEMENTED;
}

bool is_in_conflict(literalt) const override
{
UNREACHABLE;
return false;
}
};

SCENARIO("miniBDD", "[core][solver][miniBDD]")
Expand Down