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._ ...@@ -8,21 +8,26 @@ import leon.lang.xlang._
object Random { object Random {
@library @library
@isabelle.noBody()
def nextBoolean(): Boolean = epsilon((x: Boolean) => true) def nextBoolean(): Boolean = epsilon((x: Boolean) => true)
@library @library
@isabelle.noBody()
def nextInt(): Int = epsilon((x: Int) => true) def nextInt(): Int = epsilon((x: Int) => true)
@library @library
@isabelle.noBody()
def nextInt(max: Int): Int = { def nextInt(max: Int): Int = {
require(max > 0) require(max > 0)
epsilon((x: Int) => x >= 0 && x < max) epsilon((x: Int) => x >= 0 && x < max)
} ensuring(res => res >= 0 && res < max) } ensuring(res => res >= 0 && res < max)
@library @library
@isabelle.noBody()
def nextBigInt(): BigInt = epsilon((x: BigInt) => true) def nextBigInt(): BigInt = epsilon((x: BigInt) => true)
@library @library
@isabelle.noBody()
def nextBigInt(max: BigInt): BigInt = { def nextBigInt(max: BigInt): BigInt = {
require(max > 0) require(max > 0)
epsilon((x: BigInt) => x >= 0 && x < max) epsilon((x: BigInt) => x >= 0 && x < max)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment