File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,38 @@ stored in the given arrays are equal. The function
125125the array **dest**. The function **\_\_CPROVER\_array\_set** initializes
126126the array **dest** with the given value.
127127
128+
129+ #### \_\_CPROVER\_enum\_is\_in\_range
130+
131+ ```C
132+ __CPROVER_bool __CPROVER_enum_is_in_range();
133+ ```
134+
135+ The function ** \_\_ CPROVER\_ enum\_ is\_ in\_ range** is used to check
136+ that an enumeration has one of the defined enumeration values. In
137+ the following example ` __CPROVER_enum_is_in_range(ev1) ` will return
138+ true and the assertion will pass
139+ ``` C
140+ enum my_enum { first, second };
141+
142+ int main()
143+ {
144+ enum my_enum ev1 = second;
145+ assert (__CPROVER_enum_is_in_range (ev1));
146+ }
147+ ```
148+ However, in the example below the assertion will fail
149+ ```C
150+ enum my_enum { first, second };
151+
152+ int main()
153+ {
154+ enum my_enum ev1 = second + 1;
155+ assert(__CPROVER_enum_is_in_range(ev1));
156+ }
157+ ```
158+
159+
128160#### Uninterpreted Functions
129161
130162Uninterpreted functions are documented [ here] ( ./modeling-nondeterminism.md ) ).
You can’t perform that action at this time.
0 commit comments