summaryrefslogtreecommitdiff
path: root/Source/Predication
diff options
context:
space:
mode:
authorGravatar allydonaldson <unknown>2013-03-01 09:57:46 +0000
committerGravatar allydonaldson <unknown>2013-03-01 09:57:46 +0000
commit9dd6232267e919a14321b07950ad7860bc29b082 (patch)
treeec5b3ad5ffd191eeeb7a32addc31e7ced4c78987 /Source/Predication
parent1951165d1787228d6f3571930d4d582d354c7c2c (diff)
Fixed bug with predication, and fixed small problem with model generation related to casting
Diffstat (limited to 'Source/Predication')
-rw-r--r--Source/Predication/SmartBlockPredicator.cs22
1 files changed, 17 insertions, 5 deletions
diff --git a/Source/Predication/SmartBlockPredicator.cs b/Source/Predication/SmartBlockPredicator.cs
index 834099ff..55e73161 100644
--- a/Source/Predication/SmartBlockPredicator.cs
+++ b/Source/Predication/SmartBlockPredicator.cs
@@ -94,7 +94,9 @@ public class SmartBlockPredicator {
cmdSeq.Add(aCmd);
} else if (cmd is AssumeCmd) {
var aCmd = (AssumeCmd)cmd;
- cmdSeq.Add(new AssumeCmd(Token.NoToken, Expr.Imp(p, aCmd.Expr)));
+ Expr newExpr = new EnabledReplacementVisitor(p).VisitExpr(aCmd.Expr);
+ aCmd.Expr = QKeyValue.FindBoolAttribute(aCmd.Attributes, "do_not_predicate") ? newExpr : Expr.Imp(p, newExpr);
+ cmdSeq.Add(aCmd);
} else if (cmd is HavocCmd) {
var hCmd = (HavocCmd)cmd;
foreach (IdentifierExpr v in hCmd.Vars) {
@@ -216,12 +218,22 @@ public class SmartBlockPredicator {
while (i.MoveNext()) {
var block = i.Current;
- if (uni != null && uni.IsUniform(impl.Name, block.Item1))
- continue;
+
if (block.Item2) {
- if (block.Item1 == header)
+ if (block.Item1 == header) {
return;
- } else {
+ }
+ }
+
+ if (uni != null && uni.IsUniform(impl.Name, block.Item1)) {
+ if (blockGraph.Headers.Contains(block.Item1)) {
+ parentMap[block.Item1] = header;
+ AssignPredicates(blockGraph, dom, pdom, i, headPredicate, ref predCount);
+ }
+ continue;
+ }
+
+ if (!block.Item2) {
if (blockGraph.Headers.Contains(block.Item1)) {
parentMap[block.Item1] = header;
var loopPred = FreshPredicate(ref predCount);