Skip to content
Snippets Groups Projects
Commit ac55292e authored by Regis Blanc's avatar Regis Blanc Committed by Ravi
Browse files

regression test for new extern behaviour

parent 2454d614
No related branches found
No related tags found
No related merge requests found
import leon.annotation._
object SpecWithExtern {
//random between returns any value between l and h.
//For execution via scalac, we pick one valid implementation, but
//we would like the program to be verified versus any possible
//implementation, which should happen thanks to @extern
@extern
def randomBetween(l: Int, h: Int): Int = {
require(l <= h)
l
} ensuring(res => (res >= l && res <= h))
//postcondition is wrong, but if leon considers
//actual body of randomBetween it would be correct
def wrongProp(): Int = {
randomBetween(0, 10)
} ensuring(res => res >= 0 && res < 10)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment