Open viper-admin opened 6 years ago
@vakaras commented on 2018-07-25 09:15
Carbon issue.
@mschwerhoff commented on 2018-08-07 14:01
@vakaras @alexanderjsummers Did you look at Z3's axiom instantiation statistics to confirm your matching loop theory ? It could also be that Z3's macro finder optimisation — an optimisation that affects axioms that (recursively) define mathematical functions, and that can probably be turned off for the purpose of debugging/exploring this issue — kicks in here.
@vakaras commented on 2018-08-15 10:00
@mschwerhoff
I have added the following method:
#!silver
method test3a(n: Int) {
assert fib3(n) > 0
}
Executed Silicon with Z3 logging enabled:
#!bash
> silicon test.vpr --z3Args '"TRACE=true"'
Silicon 1.1-SNAPSHOT (<https://github.com/viperproject/silicon/commit/caf6da66fa6286347edaf0bc154103745cb91bc8>)
(c) Copyright ETH Zurich 2012 - 2017
Silicon found 1 error in 39,24s:
[0] Assert might fail. Assertion fib3(n) > 0 might not hold. (test.vpr@28.5)
And imported the resulting log into the axiom profiler. In the axiom profiler I can see a very long chain of fib3%limited
instantiations.
Does this answer your question?
The functions
fib3
andfib4
below cause matching loops as illustrated with asserts in the methodstest3
andtest4
(to verify these methods, the verifier would need to unroll the functions 4 times on its own, which means that it is very likely that the verifier would try to unroll the functions arbitrary number of times, which means that we have a matching loop):A work around would be to remove the postcondition because it is implied by the function body.