Quantcast
Channel: Dafny: An Automatic Program Verifier for Functional Correctness
Viewing all articles
Browse latest Browse all 1106

Closed Unassigned: Difficult to use body of mutually recursive functions [75]

$
0
0
"assume R; assert body_of_R;" fails in lemma L1 below.

```
predicate R1(x:int, y:int) { x > 0 ==> R2(x - 1) }
predicate R2(x:int) { exists y :: R1(x, y) }

lemma L1(x:int)
{
assume R2(x);
assert exists y :: R1(x, y); // FAILS
}

lemma L2(x:int)
requires R2(x); // Oddly, adding this requires fixes the problem
{
assume R2(x);
assert exists y :: R1(x, y); // SUCCEEDS
}
```


Viewing all articles
Browse latest Browse all 1106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>