Skip to content

Commit a17fb36

Browse files
Split out is_in_conflict solver capability
This is only provided by the prop_conv_solvert-based hierarchy at the moment and is quite specific to MiniSAT-based solvers. The functionality itself is used out-of-tree only (2LS).
1 parent f62db13 commit a17fb36

File tree

5 files changed

+30
-11
lines changed

5 files changed

+30
-11
lines changed

src/solvers/prop/decision_procedure_assumptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ class decision_procedure_assumptionst : public decision_procedure_incrementalt
2020
/// Set assumptions for the next call to operator() to solve the problem
2121
virtual void set_assumptions(const bvt &) = 0;
2222

23-
/// Returns true if an assumption is in the final conflict
24-
virtual bool is_in_conflict(literalt l) const = 0;
25-
2623
virtual ~decision_procedure_assumptionst() = default;
2724
};
2825

src/solvers/prop/prop_conv_solver.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ Author: Daniel Kroening, [email protected]
2020
#include "literal.h"
2121
#include "literal_expr.h"
2222
#include "prop.h"
23+
#include "solver_conflicts.h"
2324
#include "solver_resource_limits.h"
2425

2526
class prop_conv_solvert : public decision_procedure_assumptionst,
27+
public solver_conflictst,
2628
public solver_resource_limitst
2729
{
2830
public:

src/solvers/prop/solver_conflicts.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*******************************************************************\
2+
3+
Module: Capability to return assumptions that are in a conflict
4+
when solving under assumptions
5+
6+
Author: Peter Schrammel
7+
8+
\*******************************************************************/
9+
10+
/// \file
11+
/// Capability to return assumptions that are in a conflict
12+
// when solving under assumptions
13+
14+
#ifndef CPROVER_SOLVERS_PROP_SOLVER_CONFLICTS_H
15+
#define CPROVER_SOLVERS_PROP_SOLVER_CONFLICTS_H
16+
17+
class literalt;
18+
19+
class solver_conflictst
20+
{
21+
public:
22+
/// Returns true if an assumption is in the final conflict
23+
virtual bool is_in_conflict(literalt) const = 0;
24+
25+
virtual ~solver_conflictst() = default;
26+
};
27+
28+
#endif // CPROVER_SOLVERS_PROP_SOLVER_CONFLICTS_H

src/solvers/smt2/smt2_conv.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,6 @@ void smt2_convt::set_all_frozen()
7575
// not needed
7676
}
7777

78-
bool smt2_convt::is_in_conflict(literalt l) const
79-
{
80-
// we cannot do that
81-
UNREACHABLE;
82-
return false;
83-
}
84-
8578
void smt2_convt::write_header()
8679
{
8780
out << "; SMT 2" << "\n";

src/solvers/smt2/smt2_conv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ class smt2_convt : public decision_procedure_assumptionst
116116
literalt convert(const exprt &expr) override;
117117
void set_frozen(literalt) override;
118118
void set_all_frozen() override;
119-
bool is_in_conflict(literalt l) const override;
120119
void set_to(const exprt &expr, bool value) override;
121120
exprt get(const exprt &expr) const override;
122121
std::string decision_procedure_text() const override

0 commit comments

Comments
 (0)