Closed DavePearce closed 6 years ago
UPDATE: one interesting thing is that changing nat i = 0
to int i = 0
and it works out fine. Based on that, here's another example which is failing in the same way:
function f() -> (int r)
ensures r < -1:
//
int i = 0
//
return f()+1
It seems like any kind of resolution from within the interpreter during counterexample generation is doomed.
The minimal WyAL which causes the problem is this:
type nat is (int x)
where:
x >= 0
assert:
forall(nat i):
if:
i == 0
then:
i < -1
Have fixed case for constrained types, but not function invocations. The latter is more complex because we need to examine the return type. Furthermore, we ideally need to record what decision we made here.
This test case is also failing for reasons unknown:
type nat is (int x) where x >= 0
function f(int x) -> (int r)
ensures r <= 2:
//
return x+1
Looks like the problem is another exception raised here:
Exception in thread "main" java.lang.NullPointerException
at wybs.util.AbstractSyntacticHeap.internalAllocate(Unknown Source)
at wybs.util.AbstractSyntacticHeap.allocate(Unknown Source)
Am closing this now, as remaining issues are "features" to be implemented.
The following illustrates some kind of failure in counter-example generation:
The problem is that, when counter example generation is activated, it fails to report a compile-time error. Running from the command-line is helpful:
An exception is arising and this is likely the culprit. But, it's not clear why!