Skip to content
Snippets Groups Projects
Commit 99e43b6b authored by Régis Blanc's avatar Régis Blanc
Browse files

Random library isabelle.noBody

parent fa1540e0
No related branches found
No related tags found
No related merge requests found
......@@ -8,21 +8,26 @@ import leon.lang.xlang._
object Random {
@library
@isabelle.noBody()
def nextBoolean(): Boolean = epsilon((x: Boolean) => true)
@library
@isabelle.noBody()
def nextInt(): Int = epsilon((x: Int) => true)
@library
@isabelle.noBody()
def nextInt(max: Int): Int = {
require(max > 0)
epsilon((x: Int) => x >= 0 && x < max)
} ensuring(res => res >= 0 && res < max)
@library
@isabelle.noBody()
def nextBigInt(): BigInt = epsilon((x: BigInt) => true)
@library
@isabelle.noBody()
def nextBigInt(max: BigInt): BigInt = {
require(max > 0)
epsilon((x: BigInt) => x >= 0 && x < max)
......
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