Skip to content

Instantly share code, notes, and snippets.

@mantognini
Last active August 29, 2015 14:17
Show Gist options
  • Save mantognini/e63e89ccd9f7601f8e2b to your computer and use it in GitHub Desktop.
Save mantognini/e63e89ccd9f7601f8e2b to your computer and use it in GitHub Desktop.
import leon.lang._
import leon.collection._
import leon._
object Test {
def exp(a: BigInt, i: BigInt): BigInt = {
require(i>=0)
if (i == 0) 1
else a * exp(a, i-1)
}
def lemma(a: BigInt, i: BigInt, j: BigInt): Boolean = {
require(i >= 0 && j >= 0)
exp(a, i+j) == exp(a, i) * exp(a, j) && {
if (j == 0) true
else lemma(a, i, j-1)
}
}.holds
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment