Skip to content

Commit 312343e

Browse files
author
Daniel Kroening
committed
new decision_proceduret interface
1 parent 2eeee45 commit 312343e

File tree

12 files changed

+59
-23
lines changed

12 files changed

+59
-23
lines changed

src/goto-checker/solver_factory.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Author: Daniel Kroening, Peter Schrammel
1616

1717
#include <solvers/smt2/smt2_dec.h>
1818

19+
#include <fstream>
20+
1921
class message_handlert;
2022
class namespacet;
2123
class optionst;

src/goto-instrument/accelerate/scratch_program.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Author: Matt Lewis
1313

1414
#include <util/fixedbv.h>
1515

16-
#include <solvers/prop/decision_procedure.h>
16+
#include <solvers/decision_procedure.h>
1717

1818
#include <goto-symex/slice.h>
1919

src/solvers/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ SRC = $(BOOLEFORCE_SRC) \
7979
$(PICOSAT_SRC) \
8080
$(SQUOLEM2_SRC) \
8181
$(CADICAL_SRC) \
82+
decision_procedure.cpp \
8283
flattening/arrays.cpp \
8384
flattening/boolbv.cpp \
8485
flattening/boolbv_abs.cpp \
@@ -144,12 +145,12 @@ SRC = $(BOOLEFORCE_SRC) \
144145
bdd/miniBDD/miniBDD.cpp \
145146
prop/bdd_expr.cpp \
146147
prop/cover_goals.cpp \
147-
prop/decision_procedure.cpp \
148148
prop/literal.cpp \
149149
prop/prop_minimize.cpp \
150150
prop/prop.cpp \
151151
prop/prop_conv.cpp \
152152
prop/prop_conv_solver.cpp \
153+
prop/prop_decision_procedure.cpp \
153154
qbf/qbf_quantor.cpp \
154155
qbf/qbf_qube.cpp \
155156
qbf/qbf_qube_core.cpp \

src/solvers/prop/decision_procedure.h renamed to src/solvers/decision_procedure.h

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,13 @@ Author: Daniel Kroening, [email protected]
99
/// \file
1010
/// Decision Procedure Interface
1111

12-
#ifndef CPROVER_SOLVERS_PROP_DECISION_PROCEDURE_H
13-
#define CPROVER_SOLVERS_PROP_DECISION_PROCEDURE_H
12+
#ifndef CPROVER_SOLVERS_DECISION_PROCEDURE_H
13+
#define CPROVER_SOLVERS_DECISION_PROCEDURE_H
1414

1515
#include <iosfwd>
1616
#include <string>
1717

18-
#include "literal.h"
19-
2018
class exprt;
21-
class tvt;
2219

2320
class decision_proceduret
2421
{
@@ -33,9 +30,6 @@ class decision_proceduret
3330
/// For a Boolean expression \p expr, add the constraint 'not expr'
3431
void set_to_false(const exprt &expr);
3532

36-
/// Convert a Boolean expression and return the corresponding literal
37-
virtual literalt convert(const exprt &expr) = 0;
38-
3933
/// Result of running the decision procedure
4034
enum class resultt
4135
{
@@ -52,10 +46,6 @@ class decision_proceduret
5246
/// Return `nil` if not available
5347
virtual exprt get(const exprt &expr) const = 0;
5448

55-
/// Return value of literal \p l from satisfying assignment.
56-
/// Return tvt::UNKNOWN if not available
57-
virtual tvt l_get(literalt l) const = 0;
58-
5949
/// Print satisfying assignment to \p out
6050
virtual void print_assignment(std::ostream &out) const = 0;
6151

@@ -80,4 +70,4 @@ operator<<(decision_proceduret &dest, const exprt &src)
8070
return dest;
8171
}
8272

83-
#endif // CPROVER_SOLVERS_PROP_DECISION_PROCEDURE_H
73+
#endif // CPROVER_SOLVERS_DECISION_PROCEDURE_H

src/solvers/prop/cover_goals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Author: Daniel Kroening, [email protected]
1414

1515
#include <list>
1616

17-
#include "decision_procedure.h"
1817
#include "literal.h"
18+
#include "prop_decision_procedure.h"
1919

2020
class message_handlert;
2121
class prop_convt;

src/solvers/prop/prop_conv.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,16 @@ Author: Daniel Kroening, [email protected]
1010
#ifndef CPROVER_SOLVERS_PROP_PROP_CONV_H
1111
#define CPROVER_SOLVERS_PROP_PROP_CONV_H
1212

13-
#include "decision_procedure.h"
13+
#include "prop_decision_procedure.h"
1414

1515
// API that provides a "handle" in the form of a literalt
1616
// for expressions.
1717

18-
class prop_convt:public decision_proceduret
18+
class prop_convt : public prop_decision_proceduret
1919
{
2020
public:
2121
virtual ~prop_convt() { }
2222

23-
using decision_proceduret::operator();
24-
2523
// incremental solving
2624
virtual void set_frozen(literalt a);
2725
virtual void set_frozen(const bvt &);

src/solvers/prop/prop_conv_solver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Author: Daniel Kroening, [email protected]
1616
#include <util/message.h>
1717
#include <util/std_expr.h>
1818

19-
#include "decision_procedure.h"
2019
#include "literal.h"
2120
#include "literal_expr.h"
2221
#include "prop.h"
2322
#include "prop_conv.h"
23+
#include "prop_decision_procedure.h"
2424
#include "solver_resource_limits.h"
2525

2626
class prop_conv_solvert : public prop_convt, public solver_resource_limitst
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*******************************************************************\
2+
3+
Module: Decision Procedure Interface with Propositional Handles
4+
5+
Author: Daniel Kroening, [email protected]
6+
7+
\*******************************************************************/
8+
9+
/// \file
10+
/// Decision Procedure Interface with Propositional Handles
11+
12+
#include "prop_decision_procedure.h"
13+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*******************************************************************\
2+
3+
Module: Decision Procedure Interface with Propositional Handles
4+
5+
Author: Daniel Kroening, [email protected]
6+
7+
\*******************************************************************/
8+
9+
/// \file
10+
/// Decision Procedure Interface with Propositional Handles
11+
12+
#ifndef CPROVER_SOLVERS_PROP_DECISION_PROCEDURE_H
13+
#define CPROVER_SOLVERS_PROP_DECISION_PROCEDURE_H
14+
15+
#include "../decision_procedure.h"
16+
17+
#include "literal.h"
18+
19+
#include <util/threeval.h>
20+
21+
class prop_decision_proceduret : public decision_proceduret
22+
{
23+
public:
24+
/// Convert a Boolean expression and return the corresponding literal
25+
virtual literalt convert(const exprt &expr) = 0;
26+
27+
/// Return value of literal \p l from satisfying assignment.
28+
/// Return tvt::UNKNOWN if not available
29+
virtual tvt l_get(literalt l) const = 0;
30+
};
31+
32+
#endif // CPROVER_SOLVERS_PROP_DECISION_PROCEDURE_H

src/solvers/smt2/smt2_dec.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Author: Daniel Kroening, [email protected]
1818

1919
#include "smt2irep.h"
2020

21+
#include <fstream>
22+
2123
std::string smt2_dect::decision_procedure_text() const
2224
{
2325
// clang-format off

src/solvers/smt2/smt2_dec.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ Author: Daniel Kroening, [email protected]
1414

1515
#include <util/message.h>
1616

17-
#include <fstream>
18-
1917
class smt2_stringstreamt
2018
{
2119
protected:

0 commit comments

Comments
 (0)