Skip to content

Instantly share code, notes, and snippets.

@jepler
Created January 28, 2015 00:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jepler/baf8e7da47f24e50bc2e to your computer and use it in GitHub Desktop.
Save jepler/baf8e7da47f24e50bc2e to your computer and use it in GitHub Desktop.
// cbmc cmbc.c ref.c jepler.c -DBUFSIZE=1 -DCMBC
#include "nibble.h"
#include <assert.h>
#include <inttypes.h>
#include <string.h>
uint64_t nondet_u64();
void main() {
setup_jepler();
uint64_t ref[BUFSIZE], res[BUFSIZE];
int i;
for(i=0; i<BUFSIZE; i++) ref[i] = res[i] = nondet_u64();
nibble_sort_ref(ref);
nibble_sort_jepler(res);
for(i=0; i<BUFSIZE; i++) assert(ref[i] == res[i]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment