17
17
18
18
class exprt ;
19
19
20
+ // / An interface for a decision procedure for satisfiability problems.
20
21
class decision_proceduret
21
22
{
22
23
public:
23
24
// / For a Boolean expression \p expr, add the constraint 'expr' if \p value
24
25
// / is `true`, otherwise add 'not expr'
25
- virtual void set_to (const exprt &expr , bool value) = 0;
26
+ virtual void set_to (const exprt &, bool value) = 0;
26
27
27
28
// / For a Boolean expression \p expr, add the constraint 'expr'
28
- void set_to_true (const exprt &expr );
29
+ void set_to_true (const exprt &);
29
30
30
31
// / For a Boolean expression \p expr, add the constraint 'not expr'
31
- void set_to_false (const exprt &expr );
32
+ void set_to_false (const exprt &);
32
33
33
34
// / Generate a handle, which is an expression that
34
35
// / has the same value as the argument in any model
@@ -37,7 +38,7 @@ class decision_proceduret
37
38
// / \ref set_to.
38
39
// / The returned expression may be the expression itself or a more compact
39
40
// / but solver-specific representation.
40
- virtual exprt handle (const exprt &expr ) = 0;
41
+ virtual exprt handle (const exprt &) = 0;
41
42
42
43
// / Result of running the decision procedure
43
44
enum class resultt
@@ -48,12 +49,18 @@ class decision_proceduret
48
49
};
49
50
50
51
// / Run the decision procedure to solve the problem
52
+ // / This corresponds to SMT-LIB's check-sat.
51
53
resultt operator ()();
52
54
55
+ // / Run the decision procedure to solve the problem under
56
+ // / the given assumption.
57
+ // / This corresponds to SMT-LIB's check-sat-assuming.
58
+ resultt operator ()(const exprt &assumption);
59
+
53
60
// / Return \p expr with variables replaced by values from satisfying
54
61
// / assignment if available.
55
62
// / Return `nil` if not available
56
- virtual exprt get (const exprt &expr ) const = 0;
63
+ virtual exprt get (const exprt &) const = 0;
57
64
58
65
// / Print satisfying assignment to \p out
59
66
virtual void print_assignment (std::ostream &out) const = 0;
@@ -67,8 +74,8 @@ class decision_proceduret
67
74
virtual ~decision_proceduret ();
68
75
69
76
protected:
70
- // / Run the decision procedure to solve the problem
71
- virtual resultt dec_solve () = 0;
77
+ // / Implementation of the decision procedure.
78
+ virtual resultt dec_solve (const exprt &assumption ) = 0;
72
79
};
73
80
74
81
// / Add Boolean constraint \p src to decision procedure \p dest
0 commit comments