Skip to content

Instantly share code, notes, and snippets.

@mikhailramalho
Created October 27, 2016 16:00
Show Gist options
  • Save mikhailramalho/94a4bcc43e2fa3c851f7000efd7cfa56 to your computer and use it in GitHub Desktop.
Save mikhailramalho/94a4bcc43e2fa3c851f7000efd7cfa56 to your computer and use it in GitHub Desktop.
#include <math.h>
#include <assert.h>
float nondet();
int main(void)
{
float from = nondet();
__ESBMC_assume(from > 0.0f);
__ESBMC_assume(!isinf(from));
__ESBMC_assume(!isnan(from));
union {
float a;
long b;
} from_union = { .a = from };
from_union.b++;
assert(from < from_union.a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment