Skip to content

Commit 10826a6

Browse files
authored
Merge pull request #7136 from diffblue/deterrent
add comments to warn about experimental predicates
2 parents 88b1526 + b30e88e commit 10826a6

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

src/ansi-c/c_typecheck_expr.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2291,6 +2291,7 @@ exprt c_typecheck_baset::do_special_functions(
22912291
}
22922292
else if(identifier == CPROVER_PREFIX "is_list")
22932293
{
2294+
// experimental feature for CHC encodings -- do not use
22942295
if(expr.arguments().size() != 1)
22952296
{
22962297
error().source_location = f_op.source_location();
@@ -2318,6 +2319,7 @@ exprt c_typecheck_baset::do_special_functions(
23182319
}
23192320
else if(identifier == CPROVER_PREFIX "is_dll")
23202321
{
2322+
// experimental feature for CHC encodings -- do not use
23212323
if(expr.arguments().size() != 1)
23222324
{
23232325
error().source_location = f_op.source_location();
@@ -2345,6 +2347,7 @@ exprt c_typecheck_baset::do_special_functions(
23452347
}
23462348
else if(identifier == CPROVER_PREFIX "is_cyclic_dll")
23472349
{
2350+
// experimental feature for CHC encodings -- do not use
23482351
if(expr.arguments().size() != 1)
23492352
{
23502353
error().source_location = f_op.source_location();
@@ -2372,6 +2375,7 @@ exprt c_typecheck_baset::do_special_functions(
23722375
}
23732376
else if(identifier == CPROVER_PREFIX "is_sentinel_dll")
23742377
{
2378+
// experimental feature for CHC encodings -- do not use
23752379
if(expr.arguments().size() != 2 && expr.arguments().size() != 3)
23762380
{
23772381
error().source_location = f_op.source_location();
@@ -2402,6 +2406,7 @@ exprt c_typecheck_baset::do_special_functions(
24022406
}
24032407
else if(identifier == CPROVER_PREFIX "is_cstring")
24042408
{
2409+
// experimental feature for CHC encodings -- do not use
24052410
if(expr.arguments().size() != 1)
24062411
{
24072412
error().source_location = f_op.source_location();
@@ -2425,6 +2430,7 @@ exprt c_typecheck_baset::do_special_functions(
24252430
}
24262431
else if(identifier == CPROVER_PREFIX "cstrlen")
24272432
{
2433+
// experimental feature for CHC encodings -- do not use
24282434
if(expr.arguments().size() != 1)
24292435
{
24302436
error().source_location = f_op.source_location();

src/ansi-c/cprover_builtin_headers.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,20 @@ __CPROVER_bool __CPROVER_equal();
1010
__CPROVER_bool __CPROVER_same_object(const void *, const void *);
1111
__CPROVER_bool __CPROVER_is_invalid_pointer(const void *);
1212
_Bool __CPROVER_is_zero_string(const void *);
13-
// a singly-linked null-terminated dynamically-allocated list
14-
__CPROVER_bool __CPROVER_is_list();
15-
__CPROVER_bool __CPROVER_is_dll();
16-
__CPROVER_bool __CPROVER_is_cyclic_dll();
17-
__CPROVER_bool __CPROVER_is_sentinel_dll();
1813
__CPROVER_size_t __CPROVER_zero_string_length(const void *);
19-
__CPROVER_bool __CPROVER_is_cstring(const char *);
20-
__CPROVER_size_t __CPROVER_cstrlen(const char *);
2114
__CPROVER_size_t __CPROVER_buffer_size(const void *);
2215
__CPROVER_bool __CPROVER_r_ok();
2316
__CPROVER_bool __CPROVER_w_ok();
2417
__CPROVER_bool __CPROVER_rw_ok();
2518

19+
// experimental features for CHC encodings -- do not use
20+
__CPROVER_bool __CPROVER_is_list(); // a singly-linked null-terminated dynamically-allocated list
21+
__CPROVER_bool __CPROVER_is_dll();
22+
__CPROVER_bool __CPROVER_is_cyclic_dll();
23+
__CPROVER_bool __CPROVER_is_sentinel_dll();
24+
__CPROVER_bool __CPROVER_is_cstring(const char *);
25+
__CPROVER_size_t __CPROVER_cstrlen(const char *);
26+
2627
// bitvector analysis
2728
__CPROVER_bool __CPROVER_get_flag(const void *, const char *);
2829
void __CPROVER_set_must(const void *, const char *);

src/util/pointer_expr.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,8 @@ inline void validate_expr(const object_size_exprt &value)
10601060
}
10611061

10621062
/// A predicate that indicates that a zero-terminated string
1063-
/// starts at the given address
1063+
/// starts at the given address.
1064+
/// This is an experimental feature for CHC encodings -- do not use.
10641065
class is_cstring_exprt : public unary_predicate_exprt
10651066
{
10661067
public:
@@ -1118,6 +1119,7 @@ inline is_cstring_exprt &to_is_cstring_expr(exprt &expr)
11181119
/// An expression, akin to ISO C's strlen, that denotes the
11191120
/// length of a zero-terminated string that starts at the
11201121
/// given address. The trailing zero is not included in the count.
1122+
/// This is an experimental feature for CHC encodings -- do not use.
11211123
class cstrlen_exprt : public unary_exprt
11221124
{
11231125
public:
@@ -1172,7 +1174,8 @@ inline cstrlen_exprt &to_cstrlen_expr(exprt &expr)
11721174
return ret;
11731175
}
11741176

1175-
/// A predicate that indicates that the object pointed to is live
1177+
/// A predicate that indicates that the object pointed to is live.
1178+
/// This is an experimental feature for CHC encodings -- do not use.
11761179
class live_object_exprt : public unary_predicate_exprt
11771180
{
11781181
public:
@@ -1227,7 +1230,8 @@ inline live_object_exprt &to_live_object_expr(exprt &expr)
12271230
return ret;
12281231
}
12291232

1230-
/// A predicate that indicates that the object pointed to is writeable
1233+
/// A predicate that indicates that the object pointed to is writeable.
1234+
/// This is an experimental feature for CHC encodings -- do not use.
12311235
class writeable_object_exprt : public unary_predicate_exprt
12321236
{
12331237
public:

0 commit comments

Comments
 (0)