Last active
August 29, 2015 14:17
-
-
Save mantognini/e63e89ccd9f7601f8e2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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