#include typedef _Bool bool; extern void abort(void); #include void reach_error() { assert(0); } extern void abort(void); void assume_abort_if_not(_Bool cond) { if(!cond) {abort();} } extern const void *__VERIFIER_base_pointer(const void *ptr); extern _Bool __VERIFIER_nondet_bool(); extern int __VERIFIER_nondet_int(); extern short __VERIFIER_nondet_short(); extern unsigned int __VERIFIER_nondet_uint(); extern unsigned long __VERIFIER_nondet_ulong(); extern unsigned char __VERIFIER_nondet_uchar(); void __VERIFIER_assert(_Bool cond) { if(!cond) {reach_error();abort();} } #define __CPROVER_size_t unsigned long #undef assert #define assert(cond) \ __VERIFIER_assert(cond) /* See Makefile.common, needed? */ void abort(void) { {reach_error();abort();} } /* See: include/aws/common/assert.h */ #define __CPROVER_assert(cond, msg) \ __VERIFIER_assert(cond) #define __CPROVER_assume(cond) \ assume_abort_if_not(cond) void __CPROVER_allocated_memory(unsigned long address, unsigned long extent) { } /* Note: may assume that they have no side-effects, i.e., completely functional */ uint64_t __CPROVER_uninterpreted_hasher(const void *const a) { return (uint64_t)a; } bool __CPROVER_uninterpreted_equals(const void *const a, const void *const b) { return a == b; } int __CPROVER_uninterpreted_compare(const void *const a, const void *const b) { return a < b ? -1 : a > b ? 1 : 0; } #define __CPROVER_POINTER_OBJECT(ptr) \ __VERIFIER_base_pointer(ptr) #define __CPROVER_w_ok(ptr, len) (((len) == 0) || (ptr)) #define __CPROVER_r_ok(ptr, len) (((len) == 0) || (ptr)) _Bool __CPROVER_overflow_plus(unsigned long a, unsigned long b) { unsigned long c; return __builtin_uaddl_overflow(a, b, &c); } _Bool __CPROVER_overflow_mult(unsigned long a, unsigned long b) { unsigned long c; return __builtin_umull_overflow(a, b, &c); } #define __CPROVER_precondition(cond, msg) \ assume_abort_if_not(cond) _Bool nondet_bool() { return __VERIFIER_nondet_bool(); } int nondet_int() { return __VERIFIER_nondet_int(); } unsigned long nondet_size_t() { return __VERIFIER_nondet_ulong(); } uint16_t nondet_uint16_t() { return __VERIFIER_nondet_short(); } uint32_t nondet_uint32_t() { return __VERIFIER_nondet_uint(); } uint64_t nondet_uint64_t() { return __VERIFIER_nondet_ulong(); } uint8_t nondet_uint8_t() { return __VERIFIER_nondet_uchar(); } void *nondet_voidp() { return (void *)__VERIFIER_nondet_ulong(); }