Something weird is going on with strings (and perhaps other sequences, too) where a seemingly immaterial change in the input causes Z3 to loop.
Repro: The following two runs show the behavior. Note the `/z3opt:-T:5` switch, which gives Z3 a hard timeout of 5 seconds. (The usual /timeLimit flag seems not to have any effect on stopping Z3 in this example.)
```
$ Dafny.exe /timeLimit:5 /z3opt:-T:5 Example0.dfy
Dafny program verifier version 1.9.6.21009, Copyright (c) 2003-2015, Microsoft.
Dafny program verifier finished with 3 verified, 0 errors
Compiled assembly into Example0.dll
$ Dafny.exe /timeLimit:5 /z3opt:-T:5 Example1.dfy
Dafny program verifier version 1.9.6.21009, Copyright (c) 2003-2015, Microsoft.
Prover error: Unexpected prover response: timeout
Dafny program verifier finished with 2 verified, 0 errors, 1 inconclusive
```
Note that Example0.dfy verifies, whereas Example1.dfy causes a timeout. Here is the Example0.dfy input file:
```
function Id(a: string): string { a }
lemma Test(u: string, s: string, t: string)
{
var b := "x" + u + s;
assert Id(b)[0] == 'x';
}
```
and here is the Example1.dfy input file:
```
function Id(a: string): string { a }
lemma Test(u: string, s: string, t: string)
{
var b := "x" + u + t;
assert Id(b)[0] == 'x';
}
```
Note that these files differ only in one character, namely using `s` or `t` as the last argument to the concatenation.
Rustan
Repro: The following two runs show the behavior. Note the `/z3opt:-T:5` switch, which gives Z3 a hard timeout of 5 seconds. (The usual /timeLimit flag seems not to have any effect on stopping Z3 in this example.)
```
$ Dafny.exe /timeLimit:5 /z3opt:-T:5 Example0.dfy
Dafny program verifier version 1.9.6.21009, Copyright (c) 2003-2015, Microsoft.
Dafny program verifier finished with 3 verified, 0 errors
Compiled assembly into Example0.dll
$ Dafny.exe /timeLimit:5 /z3opt:-T:5 Example1.dfy
Dafny program verifier version 1.9.6.21009, Copyright (c) 2003-2015, Microsoft.
Prover error: Unexpected prover response: timeout
Dafny program verifier finished with 2 verified, 0 errors, 1 inconclusive
```
Note that Example0.dfy verifies, whereas Example1.dfy causes a timeout. Here is the Example0.dfy input file:
```
function Id(a: string): string { a }
lemma Test(u: string, s: string, t: string)
{
var b := "x" + u + s;
assert Id(b)[0] == 'x';
}
```
and here is the Example1.dfy input file:
```
function Id(a: string): string { a }
lemma Test(u: string, s: string, t: string)
{
var b := "x" + u + t;
assert Id(b)[0] == 'x';
}
```
Note that these files differ only in one character, namely using `s` or `t` as the last argument to the concatenation.
Rustan