cprover
cprover.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
9 #ifndef CPROVER_ANSI_C_LIBRARY_CPROVER_H
10 #define CPROVER_ANSI_C_LIBRARY_CPROVER_H
11 
12 typedef __typeof__(sizeof(int)) __CPROVER_size_t;
13 void *__CPROVER_allocate(__CPROVER_size_t size, __CPROVER_bool zero);
14 extern const void *__CPROVER_deallocated;
15 extern const void *__CPROVER_malloc_object;
16 extern __CPROVER_size_t __CPROVER_malloc_size;
18 extern const void *__CPROVER_memory_leak;
19 
20 void __CPROVER_assume(__CPROVER_bool assumption) __attribute__((__noreturn__));
21 void __CPROVER_assert(__CPROVER_bool assertion, const char *description);
22 void __CPROVER_precondition(__CPROVER_bool assertion, const char *description);
23 
24 __CPROVER_bool __CPROVER_is_zero_string(const void *);
25 __CPROVER_size_t __CPROVER_zero_string_length(const void *);
26 __CPROVER_size_t __CPROVER_buffer_size(const void *);
27 __CPROVER_bool __CPROVER_r_ok(const void *, __CPROVER_size_t);
28 __CPROVER_bool __CPROVER_w_ok(const void *, __CPROVER_size_t);
29 
30 #if 0
31 __CPROVER_bool __CPROVER_equal();
32 __CPROVER_bool __CPROVER_same_object(const void *, const void *);
33 
34 const unsigned __CPROVER_constant_infinity_uint;
35 typedef void __CPROVER_integer;
36 typedef void __CPROVER_rational;
37 void __CPROVER_initialize(void);
38 void __CPROVER_cover(__CPROVER_bool condition);
39 #endif
40 
41 void __CPROVER_input(const char *id, ...);
42 void __CPROVER_output(const char *id, ...);
43 
44 // concurrency-related
47 void __CPROVER_fence(const char *kind, ...);
48 #if 0
49 __CPROVER_thread_local unsigned long __CPROVER_thread_id=0;
50 __CPROVER_bool __CPROVER_threads_exited[__CPROVER_constant_infinity_uint];
51 unsigned long __CPROVER_next_thread_id=0;
52 
53 // traces
54 void CBMC_trace(int lvl, const char *event, ...);
55 #endif
56 
57 // pointers
58 unsigned __CPROVER_POINTER_OBJECT(const void *p);
59 signed __CPROVER_POINTER_OFFSET(const void *p);
60 __CPROVER_bool __CPROVER_DYNAMIC_OBJECT(const void *p);
61 #if 0
62 extern unsigned char __CPROVER_memory[__CPROVER_constant_infinity_uint];
64  __CPROVER_size_t address, __CPROVER_size_t extent);
65 
66 // this is ANSI-C
67 extern __CPROVER_thread_local const char __func__[__CPROVER_constant_infinity_uint];
68 
69 // this is GCC
70 extern __CPROVER_thread_local const char __FUNCTION__[__CPROVER_constant_infinity_uint];
71 extern __CPROVER_thread_local const char __PRETTY_FUNCTION__[__CPROVER_constant_infinity_uint];
72 #endif
73 
74 // float stuff
75 int __CPROVER_fpclassify(int, int, int, int, int, ...);
76 __CPROVER_bool __CPROVER_isfinite(double f);
77 __CPROVER_bool __CPROVER_isinf(double f);
78 __CPROVER_bool __CPROVER_isnormal(double f);
79 __CPROVER_bool __CPROVER_sign(double f);
80 __CPROVER_bool __CPROVER_isnanf(float f);
81 __CPROVER_bool __CPROVER_isnand(double f);
82 __CPROVER_bool __CPROVER_isnanld(long double f);
83 __CPROVER_bool __CPROVER_isfinitef(float f);
84 __CPROVER_bool __CPROVER_isfinited(double f);
85 __CPROVER_bool __CPROVER_isfiniteld(long double f);
86 __CPROVER_bool __CPROVER_isinff(float f);
87 __CPROVER_bool __CPROVER_isinfd(double f);
88 __CPROVER_bool __CPROVER_isinfld(long double f);
89 __CPROVER_bool __CPROVER_isnormalf(float f);
90 __CPROVER_bool __CPROVER_isnormald(double f);
91 __CPROVER_bool __CPROVER_isnormalld(long double f);
92 __CPROVER_bool __CPROVER_signf(float f);
93 __CPROVER_bool __CPROVER_signd(double f);
94 __CPROVER_bool __CPROVER_signld(long double f);
95 double __CPROVER_inf(void);
96 float __CPROVER_inff(void);
97 long double __CPROVER_infl(void);
98 //extern int __CPROVER_thread_local __CPROVER_rounding_mode;
99 int __CPROVER_isgreaterd(double f, double g);
100 
101 // absolute value
102 int __CPROVER_abs(int);
103 long int __CPROVER_labs(long int);
104 long long int __CPROVER_llabs(long long int);
105 double __CPROVER_fabs(double);
106 long double __CPROVER_fabsl(long double);
107 float __CPROVER_fabsf(float);
108 
109 // arrays
110 //__CPROVER_bool __CPROVER_array_equal(const void *array1, const void *array2);
111 void __CPROVER_array_copy(const void *dest, const void *src);
112 void __CPROVER_array_set(const void *dest, ...);
113 void __CPROVER_array_replace(const void *dest, const void *src);
114 
115 #if 0
116 // k-induction
117 void __CPROVER_k_induction_hint(unsigned min, unsigned max,
118 unsigned step, unsigned loop_free);
119 
120 // manual specification of predicates
121 void __CPROVER_predicate(__CPROVER_bool predicate);
122 void __CPROVER_parameter_predicates();
123 void __CPROVER_return_predicates();
124 #endif
125 
126 // pipes, write, read, close
128  _Bool widowed;
129  char data[4];
130  short next_avail;
131  short next_unread;
132 };
133 #if 0
134 extern struct __CPROVER_pipet __CPROVER_pipes[__CPROVER_constant_infinity_uint];
135 // offset to make sure we don't collide with other fds
136 extern const int __CPROVER_pipe_offset;
137 extern unsigned __CPROVER_pipe_count;
138 #endif
139 
140 void __CPROVER_set_must(const void *, const char *);
141 void __CPROVER_set_may(const void *, const char *);
142 void __CPROVER_clear_must(const void *, const char *);
143 void __CPROVER_clear_may(const void *, const char *);
144 void __CPROVER_cleanup(const void *, void (*)(void *));
145 __CPROVER_bool __CPROVER_get_must(const void *, const char *);
146 __CPROVER_bool __CPROVER_get_may(const void *, const char *);
147 
148 #define __CPROVER_danger_number_of_ops 1
149 #define __CPROVER_danger_max_solution_size 1
150 #define __CPROVER_danger_number_of_vars 1
151 #define __CPROVER_danger_number_of_consts 1
152 
153 #endif // CPROVER_ANSI_C_LIBRARY_CPROVER_H
__CPROVER_isnanld
__CPROVER_bool __CPROVER_isnanld(long double f)
__CPROVER_signld
__CPROVER_bool __CPROVER_signld(long double f)
__CPROVER_equal
__CPROVER_bool __CPROVER_equal()
__CPROVER_isinfd
__CPROVER_bool __CPROVER_isinfd(double f)
CBMC_trace
void CBMC_trace(int lvl, const char *event,...)
__typeof__
typedef __typeof__(sizeof(int)) __CPROVER_size_t
__CPROVER_atomic_end
void __CPROVER_atomic_end()
__CPROVER_isinff
__CPROVER_bool __CPROVER_isinff(float f)
__CPROVER_fpclassify
int __CPROVER_fpclassify(int, int, int, int, int,...)
__CPROVER_malloc_object
const void * __CPROVER_malloc_object
__CPROVER_signf
__CPROVER_bool __CPROVER_signf(float f)
__CPROVER_get_may
__CPROVER_bool __CPROVER_get_may(const void *, const char *)
__CPROVER_allocated_memory
void __CPROVER_allocated_memory(__CPROVER_size_t address, __CPROVER_size_t extent)
__CPROVER_llabs
long long int __CPROVER_llabs(long long int)
data
Definition: kdev_t.h:24
__CPROVER_isfinitef
__CPROVER_bool __CPROVER_isfinitef(float f)
__CPROVER_pipet::next_unread
short next_unread
Definition: cprover.h:131
__CPROVER_deallocated
const void * __CPROVER_deallocated
__CPROVER_assume
void __CPROVER_assume(__CPROVER_bool assumption) __attribute__((__noreturn__))
__CPROVER_infl
long double __CPROVER_infl(void)
__CPROVER_get_must
__CPROVER_bool __CPROVER_get_must(const void *, const char *)
__CPROVER_pipet::widowed
_Bool widowed
Definition: cprover.h:128
__CPROVER_memory_leak
const void * __CPROVER_memory_leak
__CPROVER_output
void __CPROVER_output(const char *id,...)
__CPROVER_array_copy
void __CPROVER_array_copy(const void *dest, const void *src)
__CPROVER_isnand
__CPROVER_bool __CPROVER_isnand(double f)
__CPROVER_malloc_size
__CPROVER_size_t __CPROVER_malloc_size
__CPROVER_atomic_begin
void __CPROVER_atomic_begin()
__CPROVER_buffer_size
__CPROVER_size_t __CPROVER_buffer_size(const void *)
__CPROVER_sign
__CPROVER_bool __CPROVER_sign(double f)
__CPROVER_w_ok
__CPROVER_bool __CPROVER_w_ok(const void *, __CPROVER_size_t)
__CPROVER_isinfld
__CPROVER_bool __CPROVER_isinfld(long double f)
__attribute__
int __gcc_m64 __attribute__((__vector_size__(8), __may_alias__))
Definition: gcc_builtin_headers_types.h:4
__CPROVER_malloc_is_new_array
_Bool __CPROVER_malloc_is_new_array
__CPROVER_cleanup
void __CPROVER_cleanup(const void *, void(*)(void *))
__CPROVER_labs
long int __CPROVER_labs(long int)
__CPROVER_inff
float __CPROVER_inff(void)
__CPROVER_isfinite
__CPROVER_bool __CPROVER_isfinite(double f)
__CPROVER_fence
void __CPROVER_fence(const char *kind,...)
__CPROVER_set_may
void __CPROVER_set_may(const void *, const char *)
__CPROVER_array_replace
void __CPROVER_array_replace(const void *dest, const void *src)
__CPROVER_set_must
void __CPROVER_set_must(const void *, const char *)
__CPROVER_isfinited
__CPROVER_bool __CPROVER_isfinited(double f)
__CPROVER_POINTER_OFFSET
signed __CPROVER_POINTER_OFFSET(const void *p)
__CPROVER_is_zero_string
__CPROVER_bool __CPROVER_is_zero_string(const void *)
__CPROVER_r_ok
__CPROVER_bool __CPROVER_r_ok(const void *, __CPROVER_size_t)
__CPROVER_isgreaterd
int __CPROVER_isgreaterd(double f, double g)
__CPROVER_clear_may
void __CPROVER_clear_may(const void *, const char *)
__CPROVER_assert
void __CPROVER_assert(__CPROVER_bool assertion, const char *description)
__CPROVER_precondition
void __CPROVER_precondition(__CPROVER_bool assertion, const char *description)
__CPROVER_isinf
__CPROVER_bool __CPROVER_isinf(double f)
__CPROVER_fabsl
long double __CPROVER_fabsl(long double)
__CPROVER_POINTER_OBJECT
unsigned __CPROVER_POINTER_OBJECT(const void *p)
__CPROVER_input
void __CPROVER_input(const char *id,...)
__CPROVER_abs
int __CPROVER_abs(int)
__CPROVER_fabsf
float __CPROVER_fabsf(float)
__CPROVER_k_induction_hint
void __CPROVER_k_induction_hint(unsigned min, unsigned max, unsigned step, unsigned loop_free)
__CPROVER_cover
void __CPROVER_cover(__CPROVER_bool condition)
__CPROVER_pipet::next_avail
short next_avail
Definition: cprover.h:130
__CPROVER_isnanf
__CPROVER_bool __CPROVER_isnanf(float f)
__CPROVER_isfiniteld
__CPROVER_bool __CPROVER_isfiniteld(long double f)
__CPROVER_same_object
__CPROVER_bool __CPROVER_same_object(const void *, const void *)
__CPROVER_inf
double __CPROVER_inf(void)
__CPROVER_isnormalf
__CPROVER_bool __CPROVER_isnormalf(float f)
__CPROVER_fabs
double __CPROVER_fabs(double)
__CPROVER_isnormald
__CPROVER_bool __CPROVER_isnormald(double f)
__CPROVER_allocate
void * __CPROVER_allocate(__CPROVER_size_t size, __CPROVER_bool zero)
__CPROVER_zero_string_length
__CPROVER_size_t __CPROVER_zero_string_length(const void *)
__CPROVER_isnormalld
__CPROVER_bool __CPROVER_isnormalld(long double f)
__CPROVER_clear_must
void __CPROVER_clear_must(const void *, const char *)
__CPROVER_pipet
Definition: cprover.h:127
__CPROVER_array_set
void __CPROVER_array_set(const void *dest,...)
__CPROVER_isnormal
__CPROVER_bool __CPROVER_isnormal(double f)
__CPROVER_DYNAMIC_OBJECT
__CPROVER_bool __CPROVER_DYNAMIC_OBJECT(const void *p)
__CPROVER_signd
__CPROVER_bool __CPROVER_signd(double f)