summaryrefslogtreecommitdiff
path: root/Source/Dafny/DafnyAst.cs
diff options
context:
space:
mode:
authorGravatar Bryan Parno <parno@microsoft.com>2014-01-13 21:56:40 -0800
committerGravatar Bryan Parno <parno@microsoft.com>2014-01-13 21:56:40 -0800
commit47637c8e97c4cb5f238de2f8d7f3870a869c372f (patch)
tree42c373823f9504237e90a0100fe5002d26a7d179 /Source/Dafny/DafnyAst.cs
parentc1341a323aa60f563a59355a0ede693c80dd2fc0 (diff)
Improve autoReq's interactions with opaque
Diffstat (limited to 'Source/Dafny/DafnyAst.cs')
-rw-r--r--Source/Dafny/DafnyAst.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Dafny/DafnyAst.cs b/Source/Dafny/DafnyAst.cs
index 4d67dbe9..be968cfa 100644
--- a/Source/Dafny/DafnyAst.cs
+++ b/Source/Dafny/DafnyAst.cs
@@ -4078,8 +4078,8 @@ namespace Microsoft.Dafny {
Contract.Ensures(Contract.Result<MatchCaseExpr>() != null);
ResolvedCloner cloner = new ResolvedCloner();
- var newVars = old_case.Arguments.ConvertAll(cloner.CloneBoundVar);
- new_body = VarSubstituter(old_case.Arguments, newVars, new_body);
+ var newVars = old_case.Arguments.ConvertAll(cloner.CloneBoundVar);
+ new_body = VarSubstituter(old_case.Arguments.ConvertAll<NonglobalVariable>(x=>(NonglobalVariable)x), newVars, new_body);
var new_case = new MatchCaseExpr(old_case.tok, old_case.Id, newVars, new_body);
@@ -4113,7 +4113,7 @@ namespace Microsoft.Dafny {
LHSs.Iter(p => oldVars.AddRange(p.Vars));
var newVars = new List<BoundVar>();
newLHSs.Iter(p => newVars.AddRange(p.Vars));
- body = VarSubstituter(oldVars, newVars, body);
+ body = VarSubstituter(oldVars.ConvertAll<NonglobalVariable>(x => (NonglobalVariable)x), newVars, body);
var let = new LetExpr(tok, newLHSs, RHSs, body, exact);
let.Type = body.Type; // resolve here
@@ -4135,7 +4135,7 @@ namespace Microsoft.Dafny {
body = expr.Term;
}
- body = VarSubstituter(expr.BoundVars, newVars, body);
+ body = VarSubstituter(expr.BoundVars.ConvertAll<NonglobalVariable>(x=>(NonglobalVariable)x), newVars, body);
QuantifierExpr q;
if (forall) {
@@ -4148,7 +4148,7 @@ namespace Microsoft.Dafny {
return q;
}
- private static Expression VarSubstituter(List<BoundVar> oldVars, List<BoundVar> newVars, Expression e) {
+ public static Expression VarSubstituter(List<NonglobalVariable> oldVars, List<BoundVar> newVars, Expression e) {
Contract.Requires(oldVars != null && newVars != null);
Contract.Requires(oldVars.Count == newVars.Count);