Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
d6ba7cf
Adding CHCs data structures and utilities for resolution-based large …
Sep 16, 2024
d390670
Enabling large step encoding using a flag
Sep 16, 2024
fc597d6
Comparison operators for chcs
Sep 22, 2024
26f982d
Clean up old code
Sep 22, 2024
e8bb4e7
Small fix
Sep 22, 2024
5a02d55
Extracting new chcs after transformation
Sep 22, 2024
f01cbe9
Moving from std::set to std::unordered_set
Oct 13, 2024
7672856
Naming conventions, unsigned -> size_t
Oct 13, 2024
7ae6ef2
Renaming types and function names, and adjusments to changes in API
Oct 13, 2024
c5fffbd
Adjusting API changes
Oct 13, 2024
be0662b
Equivalent query clauses may represent different properties. Allow it…
Oct 28, 2024
7638533
Adding regression tests for large step encoding of CHCs
Oct 28, 2024
8df40d1
Some comments and minor modifications
Oct 29, 2024
d4d3835
Removed whitespace
Oct 29, 2024
d75ddaf
Removed include
Oct 29, 2024
193da7a
Missing commit
Oct 30, 2024
aa6df74
Removing redundant include, and fixing function arguments
Nov 10, 2024
0f6a42a
Changing user_relations function declaration
yvizel Feb 9, 2025
ad717ba
clang format, and minor fixes to is_query, is_fact
yvizel Feb 9, 2025
fbb2194
Small fix
yvizel Feb 24, 2025
7a48436
Merge branch 'diffblue:develop' into develop
yvizel Apr 5, 2025
d559b6f
Merge branch 'diffblue:develop' into develop
yvizel Feb 7, 2026
9829381
Merge branch 'diffblue:develop' into develop
yvizel Mar 12, 2026
af9aeef
Adding CHCs data structures and utilities for resolution-based large …
Sep 16, 2024
87fd454
Enabling large step encoding using a flag
Sep 16, 2024
fe98ff1
Comparison operators for chcs
Sep 22, 2024
576e1cb
Clean up old code
Sep 22, 2024
9640342
Small fix
Sep 22, 2024
9e3be72
Extracting new chcs after transformation
Sep 22, 2024
705275b
Moving from std::set to std::unordered_set
Oct 13, 2024
752a7d7
Naming conventions, unsigned -> size_t
Oct 13, 2024
abda80d
Renaming types and function names, and adjusments to changes in API
Oct 13, 2024
8871cc8
Adjusting API changes
Oct 13, 2024
d5ce674
Equivalent query clauses may represent different properties. Allow it…
Oct 28, 2024
fd004d3
Some comments and minor modifications
Oct 29, 2024
8d971b6
Removed whitespace
Oct 29, 2024
233b603
Removed include
Oct 29, 2024
4ebca71
Removing redundant include, and fixing function arguments
Nov 10, 2024
0154279
Changing user_relations function declaration
yvizel Feb 9, 2025
9305e53
clang format, and minor fixes to is_query, is_fact
yvizel Feb 9, 2025
9be833e
Small fix
yvizel Feb 24, 2025
74cc828
Small merge fixes
yvizel Mar 15, 2026
bf56d0b
Merge branch 'diffblue:develop' into develop
yvizel Mar 15, 2026
0b95bda
Merge branch 'diffblue:develop' into develop
yvizel Mar 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions regression/cprover/large_step/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
add_test_pl_tests(
"$<TARGET_FILE:cprover>"
)
14 changes: 14 additions & 0 deletions regression/cprover/large_step/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
default: test-no-p

include ../../../src/config.inc
include ../../../src/common

test:
@../../test.pl -e -p -c '../../../../src/cprover/cprover --large-step'

test-no-p:
@../../test.pl -e -c '../../../../src/cprover/cprover --large-step'

clean:
find . -name '*.out' -execdir $(RM) '{}' \;
$(RM) tests.log
10 changes: 10 additions & 0 deletions regression/cprover/large_step/arrays/array1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
int array[10];

int main()
{
array[1l] = 10;
array[2l] = 20;
__CPROVER_assert(array[1l] == 10, "property 1"); // passes
__CPROVER_assert(array[2l] == 20, "property 2"); // passes
__CPROVER_assert(array[2l] == 30, "property 3"); // fails
}
14 changes: 14 additions & 0 deletions regression/cprover/large_step/arrays/array1.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CORE
array1.c
--text --solve --inline --no-safety
^EXIT=10$
^SIGNAL=0$
^\(\d+\) ∀ ς : state \. S10\(ς\) ⇒ S11\(ς\[element_address\(❝array❞, .*1.*\):=10\]\)$
^\(\d+\) ∀ ς : state \. S11\(ς\) ⇒ S12\(ς\[element_address\(❝array❞, .*2.*\):=20\]\)$
^\(\d+\) ∀ ς : state \. S12\(ς\) ⇒ \(ς\(element_address\(❝array❞, .*1.*\)\) = 10\)$
^\(\d+\) ∀ ς : state \. S13\(ς\) ⇒ \(ς\(element_address\(❝array❞, .*2.*\)\) = 20\)$
^\(\d+\) ∀ ς : state \. S14\(ς\) ⇒ \(ς\(element_address\(❝array❞, .*2.*\)\) = 30\)$
^\[main\.assertion\.1\] line \d+ property 1: SUCCESS$
^\[main\.assertion\.2\] line \d+ property 2: SUCCESS$
^\[main\.assertion\.3\] line \d+ property 3: REFUTED$
--
8 changes: 8 additions & 0 deletions regression/cprover/large_step/arrays/array2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
int main()
{
int array[10];
int i, j, k;
__CPROVER_assume(i == j);
__CPROVER_assert(array[i] == array[j], "property 1"); // passes
__CPROVER_assert(array[i] == array[k], "property 2"); // fails
}
11 changes: 11 additions & 0 deletions regression/cprover/large_step/arrays/array2.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CORE
array2.c
--text --solve --inline --no-safety
^EXIT=10$
^SIGNAL=0$
^\(\d+\) ∀ ς : state \. \(S13\(ς\) ∧ ς\(❝main::1::i❞\) = ς\(❝main::1::j❞\)\) ⇒ S14\(ς\)$
^\(\d+\) ∀ ς : state \. S14\(ς\) ⇒ \(ς\(element_address\(❝main::1::array❞, (ς\(❝main::1::i❞\)|cast\(ς\(❝main::1::i❞\), signedbv\[64\]\))\)\) = ς\(element_address\(❝main::1::array❞, (ς\(❝main::1::j❞\)|cast\(ς\(❝main::1::j❞\), signedbv\[64\]\))\)\)\)$
^\(\d+\) ∀ ς : state \. S15\(ς\) ⇒ \(ς\(element_address\(❝main::1::array❞, (ς\(❝main::1::i❞\)|cast\(ς\(❝main::1::i❞\), signedbv\[64\]\))\)\) = ς\(element_address\(❝main::1::array❞, (ς\(❝main::1::k❞\)|cast\(ς\(❝main::1::k❞\), signedbv\[64\]\))\)\)\)$
^\[main\.assertion\.1\] line \d+ property 1: SUCCESS$
^\[main\.assertion\.2\] line \d+ property 2: REFUTED$
--
7 changes: 7 additions & 0 deletions regression/cprover/large_step/arrays/array4.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
int main()
{
int a[100];
int *p = a;
__CPROVER_assert(p[23] == a[23], "property 1"); // should pass
return 0;
}
7 changes: 7 additions & 0 deletions regression/cprover/large_step/arrays/array4.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CORE
array4.c

^EXIT=0$
^SIGNAL=0$
^\[main\.assertion\.1\] line \d+ property 1: SUCCESS$
--
8 changes: 8 additions & 0 deletions regression/cprover/large_step/arrays/array_literal1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
int array[10] = {0, 1, 2, 3, 4};

int main()
{
__CPROVER_assert(array[0l] == 0, "property 1"); // passes
__CPROVER_assert(array[1l] == 1, "property 2"); // passes
return 0;
}
8 changes: 8 additions & 0 deletions regression/cprover/large_step/arrays/array_literal1.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
array_literal1.c

^EXIT=0$
^SIGNAL=0$
^\[main\.assertion\.1\] line \d+ property 1: SUCCESS$
^\[main\.assertion\.2\] line \d+ property 2: SUCCESS$
--
8 changes: 8 additions & 0 deletions regression/cprover/large_step/arrays/array_literal2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
int array[] = {'a', 'b', 'c', 'd', 'e', 'f'};

int main()
{
int i;
if(i >= 0 && i <= 5)
__CPROVER_assert(array[i] == 'a' + i, "property 1"); // passes
}
7 changes: 7 additions & 0 deletions regression/cprover/large_step/arrays/array_r_ok1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
int main()
{
unsigned char array[10];
__CPROVER_assert(__CPROVER_r_ok(array, 10), "property 1");
unsigned char *array_ptr = array;
__CPROVER_assert(__CPROVER_r_ok(array_ptr, 10), "property 2");
}
8 changes: 8 additions & 0 deletions regression/cprover/large_step/arrays/array_r_ok1.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
array_r_ok1.c

^EXIT=0$
^SIGNAL=0$
^\[main\.assertion\.1\] line \d+ property 1: SUCCESS$
^\[main\.assertion\.2\] line \d+ property 2: SUCCESS$
--
8 changes: 8 additions & 0 deletions regression/cprover/large_step/arrays/array_set1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
int array[10];

int main()
{
__CPROVER_array_set(array, 123);
__CPROVER_assert(array[5l] == 123, "property 1"); // passes
return 0;
}
7 changes: 7 additions & 0 deletions regression/cprover/large_step/arrays/array_set1.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
KNOWNBUG
array_set1.c

^EXIT=0$
^SIGNAL=0$
^\[main\.assertion\.1\] line \d+ property 1: SUCCESS$
--
7 changes: 7 additions & 0 deletions regression/cprover/large_step/arrays/iterate_over_array1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
int array[10];

int main()
{
for(__CPROVER_size_t i = 0; i < sizeof(array) / sizeof(int); i++)
array[i] = 0;
}
7 changes: 7 additions & 0 deletions regression/cprover/large_step/arrays/iterate_over_array1.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CORE
iterate_over_array1.c
--safety
^EXIT=0$
^SIGNAL=0$
^\[main\.array_bounds\.1\] line \d+ array bounds in array\[.*i\]: SUCCESS$
--
31 changes: 31 additions & 0 deletions regression/cprover/large_step/arrays/iterate_over_array2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#define size_t __CPROVER_size_t
#define false 0
#define true 1

_Bool find_zero(const void *const array, const size_t array_len)
{
const unsigned char *array_bytes = array;

// iterate over array
for(size_t i = 0; i < array_len; ++i)
// clang-format off
__CPROVER_loop_invariant(i >= 0 && i <= array_len)
__CPROVER_loop_invariant(__CPROVER_POINTER_OFFSET(array_bytes) == 0)
__CPROVER_loop_invariant(__CPROVER_r_ok(array_bytes, array_len))
// clang-format on
{
if(array_bytes[i] == 0)
{
return true;
}
}

return false;
}

int main()
{
unsigned char array[10];
size_t array_len = 10;
find_zero(array, array_len);
}
7 changes: 7 additions & 0 deletions regression/cprover/large_step/arrays/iterate_over_array2.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CORE
iterate_over_array2.c
--safety
^EXIT=0$
^SIGNAL=0$
^\[find_zero\.pointer\.1\] line \d+ pointer .* safe: SUCCESS$
--
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
KNOWNBUG
aws_array_eq_c_str_contract.c
-I aws-c-common/include aws-c-common/source/byte_buf.c
^EXIT=0$
^SIGNAL=0$
--
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Function: aws_array_eq_c_str
// Source: aws-c-common/source/byte_buf.c

#include <aws/common/byte_buf.h>

// bool aws_array_eq_c_str(const void *const array, const size_t array_len, const char *const c_str)

int main()
{
const void *array;
size_t array_len;
const char *c_str;

__CPROVER_assume(__CPROVER_r_ok(array, array_len));
__CPROVER_assume(__CPROVER_is_cstring(c_str));

aws_array_eq_c_str(array, array_len, c_str);

return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
KNOWNBUG
aws_array_eq_c_str_ignore_case_contract.c
--safety aws-c-common/source/byte_buf.c -I aws-c-common/include
^EXIT=0$
^SIGNAL=0$
--
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Function: aws_array_eq_c_str_ignore_case
// Source: aws-c-common/source/byte_buf.c

#include <aws/common/byte_buf.h>

// bool aws_array_eq_c_str_ignore_case(const void *const array, const size_t array_len, const char *const c_str)

int main()
{
const void *array;
size_t array_len;
const char *c_str;

__CPROVER_assume(__CPROVER_r_ok(array, array_len));
__CPROVER_assume(__CPROVER_is_cstring(c_str));

aws_array_eq_c_str_ignore_case(array, array_len, c_str);

return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
KNOWNBUG
aws_array_eq_ignore_case_contract.c
--safety aws-c-common/source/byte_buf.c -I aws-c-common/include
^EXIT=0$
^SIGNAL=0$
--
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Function: aws_array_eq_ignore_case
// Source: aws-c-common/source/byte_buf.c

#include <aws/common/byte_buf.h>

// bool aws_array_eq_ignore_case(
// const void *const array_a,
// const size_t len_a,
// const void *const array_b,
// const size_t len_b)

int main()
{
const void *array_a, *array_b;
size_t len_a, len_b;

__CPROVER_assume(__CPROVER_r_ok(array_a, len_a));
__CPROVER_assume(__CPROVER_r_ok(array_b, len_b));

aws_array_eq_ignore_case(array_a, len_a, array_b, len_b);

return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
KNOWNBUG
aws_hash_table_clear_contract.c
-I aws-c-common/include aws-c-common/source/hash_table.c
^EXIT=0$
^SIGNAL=0$
--
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Function: aws_hash_table_clear
// Source: source/hash_table.c

#include <aws/common/hash_table.h>

// void aws_hash_table_clear(struct aws_hash_table *map)

int main()
{
struct aws_hash_table *map;

aws_hash_table_clear(map);

return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
KNOWNBUG
aws_hash_table_eq_contract.c
-I aws-c-common/include aws-c-common/source/hash_table.c
^EXIT=0$
^SIGNAL=0$
--
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Function: aws_hash_table_eq
// Source: source/hash_table.c

#include <aws/common/hash_table.h>

// bool aws_hash_table_eq(
// const struct aws_hash_table *a,
// const struct aws_hash_table *b,
// aws_hash_callback_eq_fn *value_eq)

int main()
{
const struct aws_hash_table *a;
const struct aws_hash_table *b;
aws_hash_callback_eq_fn *value_eq;

aws_hash_table_eq(a, b, value_eq);

return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
KNOWNBUG
aws_hash_table_foreach_contract.c
-I aws-c-common/include aws-c-common/source/hash_table.c
^EXIT=0$
^SIGNAL=0$
--
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Function: aws_hash_table_foreach
// Source: source/hash_table.c

#include <aws/common/hash_table.h>

// int aws_hash_table_foreach(
// struct aws_hash_table *map,
// int (*callback)(void *context, struct aws_hash_element *pElement),
// void *context)

int main()
{
struct aws_hash_table *map;
int (*callback)(void *context, struct aws_hash_element *pElement);
void *context;

aws_hash_table_foreach(map, callback, context);

return 0;
}
6 changes: 6 additions & 0 deletions regression/cprover/large_step/aws-c-common/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

git clone https://github.com/awslabs/aws-c-common -b v0.6.13

echo "/* nothing */" > aws-c-common/include/aws/common/config.h

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CORE
aws_array_list_mem_swap_contract.c
--safety
^EXIT=0$
^SIGNAL=0$
--
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Function: aws_array_list_mem_swap

int main()
{
return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CORE
aws_byte_buf_append_with_lookup_contract.c
--safety
^EXIT=0$
^SIGNAL=0$
--
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Function: aws_byte_buf_append_with_lookup

int main()
{
return 0;
}
Loading
Loading