55#include " klee/Expr/Constraints.h"
66#include " klee/Expr/ExprHashMap.h"
77#include " klee/Expr/ExprUtil.h"
8+ #include " klee/Expr/IndependentConstraintSetUnion.h"
89#include " klee/Expr/SymbolicSource.h"
910#include " klee/Expr/Symcrete.h"
1011#include " klee/Solver/Solver.h"
@@ -29,32 +30,20 @@ IndependentConstraintSet::updateConcretization(
2930 InnerSetUnion DSU;
3031 for (ref<Expr> i : exprs) {
3132 ref<Expr> e = ics->concretization .evaluate (i);
32- if (auto ce = dyn_cast<ConstantExpr>(e)) {
33- assert (ce->isTrue () && " Attempt to add invalid constraint" );
34- continue ;
35- }
3633 concretizedExprs[i] = e;
37- DSU.addValue ( new ExprOrSymcrete::left (e) );
34+ DSU.addExpr (e );
3835 }
3936 for (ref<Symcrete> s : symcretes) {
4037 ref<Expr> e = EqExpr::create (ics->concretization .evaluate (s->symcretized ),
4138 s->symcretized );
42- if (auto ce = dyn_cast<ConstantExpr>(e)) {
43- assert (ce->isTrue () && " Attempt to add invalid constraint" );
44- continue ;
45- }
46- DSU.addValue (new ExprOrSymcrete::left (e));
39+ DSU.addExpr (e);
4740 }
4841 auto concretizationConstraints =
4942 ics->concretization .createConstraintsFromAssignment ();
5043 for (ref<Expr> e : concretizationConstraints) {
51- if (auto ce = dyn_cast<ConstantExpr>(e)) {
52- assert (ce->isTrue () && " Attempt to add invalid constraint" );
53- continue ;
54- }
55- DSU.addValue (new ExprOrSymcrete::left (e));
44+ DSU.addExpr (e);
5645 }
57- ics->concretizedSets = DSU;
46+ ics->concretizedSets . reset ( new InnerSetUnion ( DSU)) ;
5847 return ics;
5948}
6049
@@ -71,33 +60,21 @@ IndependentConstraintSet::removeConcretization(
7160 InnerSetUnion DSU;
7261 for (ref<Expr> i : exprs) {
7362 ref<Expr> e = ics->concretization .evaluate (i);
74- if (auto ce = dyn_cast<ConstantExpr>(e)) {
75- assert (ce->isTrue () && " Attempt to add invalid constraint" );
76- continue ;
77- }
7863 concretizedExprs[i] = e;
79- DSU.addValue ( new ExprOrSymcrete::left (e) );
64+ DSU.addExpr (e );
8065 }
8166 for (ref<Symcrete> s : symcretes) {
8267 ref<Expr> e = EqExpr::create (ics->concretization .evaluate (s->symcretized ),
8368 s->symcretized );
84- if (auto ce = dyn_cast<ConstantExpr>(e)) {
85- assert (ce->isTrue () && " Attempt to add invalid constraint" );
86- continue ;
87- }
88- DSU.addValue (new ExprOrSymcrete::left (e));
69+ DSU.addExpr (e);
8970 }
9071 auto concretizationConstraints =
9172 ics->concretization .createConstraintsFromAssignment ();
9273 for (ref<Expr> e : concretizationConstraints) {
93- if (auto ce = dyn_cast<ConstantExpr>(e)) {
94- assert (ce->isTrue () && " Attempt to add invalid constraint" );
95- continue ;
96- }
97- DSU.addValue (new ExprOrSymcrete::left (e));
74+ DSU.addExpr (e);
9875 }
9976
100- ics->concretizedSets = DSU;
77+ ics->concretizedSets . reset ( new InnerSetUnion ( DSU)) ;
10178 return ics;
10279}
10380
@@ -346,32 +323,20 @@ IndependentConstraintSet::merge(ref<const IndependentConstraintSet> A,
346323 InnerSetUnion DSU;
347324 for (ref<Expr> i : a->exprs ) {
348325 ref<Expr> e = a->concretization .evaluate (i);
349- if (auto ce = dyn_cast<ConstantExpr>(e)) {
350- assert (ce->isTrue () && " Attempt to add invalid constraint" );
351- continue ;
352- }
353- DSU.addValue (new ExprOrSymcrete::left (e));
326+ DSU.addExpr (e);
354327 }
355328 for (ref<Symcrete> s : a->symcretes ) {
356329 ref<Expr> e = EqExpr::create (a->concretization .evaluate (s->symcretized ),
357330 s->symcretized );
358- if (auto ce = dyn_cast<ConstantExpr>(e)) {
359- assert (ce->isTrue () && " Attempt to add invalid constraint" );
360- continue ;
361- }
362- DSU.addValue (new ExprOrSymcrete::left (e));
331+ DSU.addExpr (e);
363332 }
364333 auto concretizationConstraints =
365334 a->concretization .createConstraintsFromAssignment ();
366335 for (ref<Expr> e : concretizationConstraints) {
367- if (auto ce = dyn_cast<ConstantExpr>(e)) {
368- assert (ce->isTrue () && " Attempt to add invalid constraint" );
369- continue ;
370- }
371- DSU.addValue (new ExprOrSymcrete::left (e));
336+ DSU.addExpr (e);
372337 }
373338
374- a->concretizedSets = DSU;
339+ a->concretizedSets . reset ( new InnerSetUnion ( DSU)) ;
375340 }
376341
377342 return a;
0 commit comments