Created
November 19, 2020 22:06
-
-
Save Mr-Slippery/7cf6fbdcb6b8786912f2dbf866043535 to your computer and use it in GitHub Desktop.
Finding Ramanujan's taxicab number 1729 with KLEE
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
#include <klee/klee.h> | |
#include <assert.h> | |
#define N (15) | |
#define SYM(x) { \ | |
klee_make_symbolic(&x, sizeof x, #x); \ | |
} | |
int main() { | |
unsigned int a, b, c, d, r; | |
SYM(a); SYM(b); SYM(c); SYM(d); SYM(r); | |
klee_assert(!(a < N && b < N && c < N && d < N && | |
a * a * a + b * b * b == r && | |
c * c * c + d * d * d == r && | |
a != c && a != d)); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment