summaryrefslogtreecommitdiff
path: root/Source/VCGeneration/RPFP.cs
diff options
context:
space:
mode:
authorGravatar Ken McMillan <unknown>2013-05-29 14:24:16 -0700
committerGravatar Ken McMillan <unknown>2013-05-29 14:24:16 -0700
commit45fae1a54b2b08780945c7f18ce9b8c7f9a1f763 (patch)
treeb16f05e667c486a9f7d5b253e05a2eb5ff088dfa /Source/VCGeneration/RPFP.cs
parentbb046513677de9b18941a2cd590558fababa37bf (diff)
Getting fixed point backend to work with Corral.
Diffstat (limited to 'Source/VCGeneration/RPFP.cs')
-rw-r--r--Source/VCGeneration/RPFP.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/VCGeneration/RPFP.cs b/Source/VCGeneration/RPFP.cs
index 5d055b57..9048f0f5 100644
--- a/Source/VCGeneration/RPFP.cs
+++ b/Source/VCGeneration/RPFP.cs
@@ -174,7 +174,8 @@ namespace Microsoft.Boogie
e.number = ++edgeCount;
_Parent.Outgoing = e;
foreach (var c in _Children)
- c.Incoming.Add(e);
+ if(c != null)
+ c.Incoming.Add(e);
return e;
}
@@ -482,7 +483,9 @@ namespace Microsoft.Boogie
predSubst.Add(edge.F.RelParams[i], edge.Children[i].Name);
Term body = SubstPreds(predSubst, edge.F.Formula);
Term head = ctx.MkApp(edge.Parent.Name, edge.F.IndParams);
- return BindVariables(ctx.MkImplies(body, head));
+ var rule = BindVariables(ctx.MkImplies(body, head));
+ rule = ctx.Letify(rule); // put in let bindings for theorem prover
+ return rule;
}
/** Get the Z3 query corresponding to the conjunction of the node bounds. */
@@ -496,7 +499,9 @@ namespace Microsoft.Boogie
conjuncts.Add(ctx.MkImplies(ctx.MkApp(node.Name, node.Bound.IndParams), node.Bound.Formula));
}
Term query = ctx.MkNot(ctx.MkAnd(conjuncts.ToArray()));
- return BindVariables(query,false); // bind variables existentially
+ query = BindVariables(query,false); // bind variables existentially
+ query = ctx.Letify(query); // put in let bindings for theorem prover
+ return query;
}
private void CollectVariables(Dictionary<Term, bool> memo, Term t, List<Term> vars)