summaryrefslogtreecommitdiff
path: root/Dafny
diff options
context:
space:
mode:
authorGravatar Rustan Leino <leino@microsoft.com>2011-05-27 19:17:07 -0700
committerGravatar Rustan Leino <leino@microsoft.com>2011-05-27 19:17:07 -0700
commite9293c2e0406a1d27d948098250800f3b90f6ecb (patch)
tree907e42c5279bf3144755ad5a232ab11080020921 /Dafny
parent2dc9d6117b1a6ab03c339f725d5232881e8f8d16 (diff)
parent0d5d4501f74001c602e3c8b56c451d58714e0b6a (diff)
Merge
Diffstat (limited to 'Dafny')
-rw-r--r--Dafny/Translator.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Dafny/Translator.cs b/Dafny/Translator.cs
index 19272ef4..54a51d11 100644
--- a/Dafny/Translator.cs
+++ b/Dafny/Translator.cs
@@ -3067,7 +3067,8 @@ namespace Microsoft.Dafny {
Bpl.Expr Si = FunctionCall(stmt.Tok, BuiltinFunction.SeqIndex, predef.BoxType, S, i);
Bpl.Trigger tr = new Bpl.Trigger(stmt.Tok, true, new Bpl.ExprSeq(Si));
// TODO: in the next line, the == should be replaced by something that understands extensionality, for sets and sequences
- oInS = new Bpl.ExistsExpr(stmt.Tok, new Bpl.VariableSeq(iVar), tr, Bpl.Expr.And(range, Bpl.Expr.Eq(Si, o)));
+ var boxO = etran.BoxIfNecessary(stmt.Tok, o, ((SeqType)s.Collection.Type).Arg);
+ oInS = new Bpl.ExistsExpr(stmt.Tok, new Bpl.VariableSeq(iVar), tr, Bpl.Expr.And(range, Bpl.Expr.Eq(Si, boxO)));
}
oInS = Bpl.Expr.And(Bpl.Expr.Neq(o, predef.Null), oInS);
@@ -5533,7 +5534,7 @@ namespace Microsoft.Dafny {
// consider automatically applying induction
var inductionVariables = new List<BoundVar>();
foreach (var n in e.BoundVars) {
- if (VarOccursInArgumentToRecursiveFunction(e.LogicalBody(), n, null)) {
+ if (!n.Type.IsTypeParameter && VarOccursInArgumentToRecursiveFunction(e.LogicalBody(), n, null)) {
if (CommandLineOptions.Clo.Trace) {
Console.Write("Applying automatic induction on variable '{0}' of: ", n.Name);
new Printer(Console.Out).PrintExpression(e);