11[ CPROVER Manual TOC] ( ../ )
22
3- ## The CPROVER API Reference
3+ # The CPROVER API Reference
44
55The following sections summarize the functions available to programs
66that are passed to the CPROVER tools.
77
8- ### Functions
8+ ## Functions
99
10- #### \_\_ CPROVER\_ assume, \_\_ CPROVER\_ assert, assert
10+ ### \_\_ CPROVER\_ assume, \_\_ CPROVER\_ assert, assert
1111
1212``` C
1313void __CPROVER_assume (_ Bool assumption);
@@ -20,7 +20,7 @@ to the program. If the expression evaluates to false, the execution
2020aborts without failure. More detail on the use of assumptions is in the
2121section on [Assumptions](../modeling/assumptions/).
2222
23- #### \_\_CPROVER\_input, \_\_CPROVER\_output
23+ ### \_\_CPROVER\_input, \_\_CPROVER\_output
2424
2525```C
2626void __CPROVER_input(const char *id, ...);
@@ -35,7 +35,7 @@ using nondeterminism, as described [here](../modeling/nondeterminism/)). The
3535string constant is followed by an arbitrary number of values of
3636arbitrary types.
3737
38- #### \_\_ CPROVER\_ printf
38+ ### \_\_ CPROVER\_ printf
3939
4040``` C
4141void __CPROVER_printf (const char * format, ...);
@@ -45,7 +45,7 @@ The function **\_\_CPROVER\_printf** implements the C `printf` function (without
4545any return value). The observable effect is that its output is shown within a
4646counterexample trace.
4747
48- #### \_\_CPROVER\_cover
48+ ### \_\_CPROVER\_cover
4949
5050```C
5151void __CPROVER_cover(_Bool condition);
@@ -54,7 +54,7 @@ void __CPROVER_cover(_Bool condition);
5454This statement defines a custom coverage criterion, for usage with the
5555[ test suite generation feature] ( ../test-suite/ ) .
5656
57- #### \_\_ CPROVER\_ isnan, \_\_ CPROVER\_ isfinite, \_\_ CPROVER\_ isinf, \_\_ CPROVER\_ isnormal, \_\_ CPROVER\_ sign
57+ ### \_\_ CPROVER\_ isnan, \_\_ CPROVER\_ isfinite, \_\_ CPROVER\_ isinf, \_\_ CPROVER\_ isnormal, \_\_ CPROVER\_ sign
5858
5959``` C
6060_Bool __CPROVER_isnan (double f);
@@ -83,7 +83,7 @@ number.
8383This function **\_\_CPROVER\_sign** returns true if the double-precision
8484floating-point number passed as argument is negative.
8585
86- #### \_\_CPROVER\_abs, \_\_CPROVER\_labs, \_\_CPROVER\_fabs, \_\_CPROVER\_fabsl, \_\_CPROVER\_fabsf
86+ ### \_\_CPROVER\_abs, \_\_CPROVER\_labs, \_\_CPROVER\_fabs, \_\_CPROVER\_fabsl, \_\_CPROVER\_fabsf
8787
8888```C
8989int __CPROVER_abs(int x);
@@ -95,7 +95,7 @@ float __CPROVER_fabsf(float x);
9595
9696These functions return the absolute value of the given argument.
9797
98- #### \_\_ CPROVER\_ overflow\_ minus, \_\_ CPROVER\_ overflow\_ mult, \_\_ CPROVER\_ overflow\_ plus, \_\_ CPROVER\_ overflow\_ shl, \_\_ CPROVER\_ overflow\_ unary\_ minus
98+ ### \_\_ CPROVER\_ overflow\_ minus, \_\_ CPROVER\_ overflow\_ mult, \_\_ CPROVER\_ overflow\_ plus, \_\_ CPROVER\_ overflow\_ shl, \_\_ CPROVER\_ overflow\_ unary\_ minus
9999
100100``` C
101101__CPROVER_bool __CPROVER_overflow_minus ();
@@ -111,7 +111,7 @@ operation would overflow when applied to the arguments. For example,
111111` __CPROVER_overflow_plus(x, y) ` returns true if ` x + y ` would result in an
112112arithmetic overflow.
113113
114- #### \_\_ CPROVER\_ array\_ equal, \_\_ CPROVER\_ array\_ copy, \_\_ CPROVER\_ array\_ set
114+ ### \_\_ CPROVER\_ array\_ equal, \_\_ CPROVER\_ array\_ copy, \_\_ CPROVER\_ array\_ set
115115
116116``` C
117117_Bool __CPROVER_array_equal (const void array1[ ] , const void array2[ ] );
@@ -126,7 +126,7 @@ the array **dest**. The function **\_\_CPROVER\_array\_set** initializes
126126the array **dest** with the given value.
127127
128128
129- #### \_\_CPROVER\_enum\_is\_in\_range
129+ ### \_\_CPROVER\_enum\_is\_in\_range
130130
131131```C
132132__CPROVER_bool __CPROVER_enum_is_in_range();
@@ -157,16 +157,16 @@ int main()
157157```
158158
159159
160- #### Uninterpreted Functions
160+ ## Uninterpreted Functions
161161
162- Uninterpreted functions are documented [ here] ( ../modeling/nondeterminism/ ) ) .
162+ Uninterpreted functions are documented [ here] ( ../modeling/nondeterminism/ ) .
163163
164- ### Memory-Related Functions
164+ ## Memory-Related Functions
165165
166166The semantics of the primitives listed in this section is described in more detail in the
167167document about [ Memory Primitives] ( ../memory-primitives/ ) .
168168
169- #### \_\_ CPROVER\_ POINTER\_ OBJECT, \_\_ CPROVER\_ POINTER\_ OFFSET, \_\_ CPROVER\_ same\_ object
169+ ### \_\_ CPROVER\_ POINTER\_ OBJECT, \_\_ CPROVER\_ POINTER\_ OFFSET, \_\_ CPROVER\_ same\_ object
170170
171171``` C
172172__CPROVER_size_t __CPROVER_POINTER_OBJECT (const void * p);
@@ -180,7 +180,7 @@ offset of the given pointer relative to the base address of the object. The
180180function **\_\_CPROVER\_same\_object** returns true if the two pointers given as
181181arguments point to the same object.
182182
183- #### \_\_CPROVER\_OBJECT\_SIZE, \_\_CPROVER\_DYNAMIC\_OBJECT, \_\_CPROVER\_r\_ok, \_\_CPROVER\_w\_ok
183+ ### \_\_CPROVER\_OBJECT\_SIZE, \_\_CPROVER\_DYNAMIC\_OBJECT, \_\_CPROVER\_r\_ok, \_\_CPROVER\_w\_ok
184184
185185The following primitives require a pointer that is null or valid in order to
186186have well-defined semantics in all usage cases. See the document about
@@ -211,7 +211,7 @@ returns true when it is safe to do both. These predicates can be given an
211211optional size; when the size argument is not given, the size of the subtype
212212(which must not be ** void** ) of the pointer type is used.
213213
214- #### \_\_ CPROVER\_ havoc\_ object
214+ ### \_\_ CPROVER\_ havoc\_ object
215215
216216
217217This function requires a valid pointer and updates ** all bytes** of the
@@ -243,7 +243,7 @@ __CPROVER_assert(thefoo.y == 2, "fails because `thefoo.y` is now nondet");
243243__CPROVER_assert(thefoo.z == 3, "fails because `thefoo.z` is now nondet");
244244```
245245
246- #### \_\_ CPROVER\_ havoc\_ slice
246+ ### \_\_ CPROVER\_ havoc\_ slice
247247
248248This function requires requires that ` __CPROVER_w_ok(p, size) ` holds,
249249and updates ` size ` consecutive bytes of the underlying object, starting at ` p ` ,
@@ -262,9 +262,9 @@ void __CPROVER_havoc_slice(void *p, __CPROVER_size_t size);
262262 by the program, then havocing the slice is equivalent to making the
263263 interpretation of these bytes nondeterministic.
264264
265- ### Predefined Types and Symbols
265+ ## Predefined Types and Symbols
266266
267- #### \_\_CPROVER\_bitvector
267+ ### \_\_CPROVER\_bitvector
268268
269269```C
270270__CPROVER_bitvector [ expression ]
@@ -275,7 +275,7 @@ bit vector with arbitrary but fixed size. The usual integer type
275275modifiers ** signed** and ** unsigned** can be applied. The usual
276276arithmetic promotions will be applied to operands of this type.
277277
278- #### \_\_ CPROVER\_ floatbv
278+ ### \_\_ CPROVER\_ floatbv
279279
280280``` C
281281__CPROVER_floatbv [ expression ] [ expression ]
@@ -287,7 +287,7 @@ parameter is the total size (in bits) of the number, and the second is
287287the size (in bits) of the mantissa, or significand (not including the
288288hidden bit, thus for single precision this should be 23).
289289
290- #### \_\_ CPROVER\_ fixedbv
290+ ### \_\_ CPROVER\_ fixedbv
291291
292292``` C
293293__CPROVER_fixedbv [ expression ] [ expression ]
@@ -298,51 +298,51 @@ fixed-point bit vector with arbitrary but fixed size. The first
298298parameter is the total size (in bits) of the type, and the second is the
299299number of bits after the radix point.
300300
301- #### \_\_ CPROVER\_ size\_ t
301+ ### \_\_ CPROVER\_ size\_ t
302302
303303The type of sizeof expressions.
304304
305- #### \_\_ CPROVER\_ rounding\_ mode
305+ ### \_\_ CPROVER\_ rounding\_ mode
306306
307307``` C
308308extern int __CPROVER_rounding_mode;
309309```
310310
311311This variable contains the IEEE floating-point arithmetic rounding mode.
312312
313- #### \_\_ CPROVER\_ constant\_ infinity\_ uint
313+ ### \_\_ CPROVER\_ constant\_ infinity\_ uint
314314
315315This is a constant that models a large unsigned integer.
316316
317- #### \_\_ CPROVER\_ integer, \_\_ CPROVER\_ rational
317+ ### \_\_ CPROVER\_ integer, \_\_ CPROVER\_ rational
318318
319319** \_\_ CPROVER\_ integer** is an unbounded, signed integer type.
320320** \_\_ CPROVER\_ rational** is an unbounded, signed rational number type.
321321
322- #### \_\_ CPROVER\_ memory
322+ ### \_\_ CPROVER\_ memory
323323
324324``` C
325325extern unsigned char __CPROVER_memory[];
326326```
327327
328328This array models the contents of integer-addressed memory.
329329
330- #### \_\_ CPROVER::unsignedbv< ; N> ; (C++ only)
330+ ### \_\_ CPROVER::unsignedbv< ; N> ; (C++ only)
331331
332332This type is the equivalent of ** unsigned \_\_ CPROVER\_ bitvector\[ N\] **
333333in the C++ front-end.
334334
335- #### \_\_ CPROVER::signedbv< ; N> ; (C++ only)
335+ ### \_\_ CPROVER::signedbv< ; N> ; (C++ only)
336336
337337This type is the equivalent of ** signed \_\_ CPROVER\_ bitvector\[ N\] ** in
338338the C++ front-end.
339339
340- #### \_\_ CPROVER::fixedbv< ; N> ; (C++ only)
340+ ### \_\_ CPROVER::fixedbv< ; N> ; (C++ only)
341341
342342This type is the equivalent of ** \_\_ CPROVER\_ fixedbv\[ N,m\] ** in the
343343C++ front-end.
344344
345- ### Concurrency
345+ ## Concurrency
346346
347347Asynchronous threads are created by preceding an instruction with a
348348label with the prefix ** \_\_ CPROVER\_ ASYNC\_ ** .
0 commit comments