Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c6bee51
Remove duplication
pgiarrusso-sl Feb 10, 2026
aed53a7
Add --no-elaborate
pgiarrusso-sl Feb 10, 2026
088dbee
TMP Update generated dune.inc
pgiarrusso-sl Feb 10, 2026
3d74eb8
Examples WIP
pgiarrusso-sl Feb 10, 2026
05c48b9
Cleanup first example a bit
pgiarrusso-sl Feb 10, 2026
7203dd3
New example, stuck on bug? Changing next
pgiarrusso-sl Feb 10, 2026
16506a4
Completed simpler example
pgiarrusso-sl Feb 10, 2026
873d3db
WIP towards full example
pgiarrusso-sl Feb 10, 2026
0aad561
more examples
pgiarrusso-sl Feb 10, 2026
854236c
Upstreaming some specs a bit
pgiarrusso-sl Feb 11, 2026
a9c3f62
More examples, with a loop invariant
pgiarrusso-sl Feb 11, 2026
296127c
Fix numbers
pgiarrusso-sl Feb 12, 2026
27be88a
Missing URLs
pgiarrusso-sl Feb 12, 2026
8fa5737
WIP readd stderr files
pgiarrusso-sl Feb 13, 2026
0b1ca4b
More name fixes
pgiarrusso-sl Feb 13, 2026
314483c
Add variant of example
pgiarrusso-sl Feb 13, 2026
faf780c
Drop non-working hint
pgiarrusso-sl Feb 13, 2026
606a130
Annotate spec stability
pgiarrusso-sl Feb 17, 2026
494df09
TODO fix buggy spec
pgiarrusso-sl Feb 17, 2026
7be4ef5
Tweak upstreamed code
pgiarrusso-sl Feb 17, 2026
ef8cae9
Tweak code to upstream
pgiarrusso-sl Feb 17, 2026
d501a50
Missing source files
pgiarrusso-sl Mar 3, 2026
5af5cd0
Fix infinite loop
pgiarrusso-sl Mar 3, 2026
741a9ba
Remove upstreamed
pgiarrusso-sl Mar 3, 2026
730dc61
Drop workaround: `verify` dependency computation was fixed
pgiarrusso-sl Mar 3, 2026
6826903
A sketch of a refinement-based setup.
gmalecha-at-skylabs Feb 13, 2026
7ed54b8
Fleshing out the example.
gmalecha-at-skylabs Mar 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 0 additions & 138 deletions rocq-brick-libstdcpp/proof/cpp2v-dune-gen.sh

This file was deleted.

1 change: 1 addition & 0 deletions rocq-brick-libstdcpp/proof/cpp2v-dune-gen.sh
18 changes: 9 additions & 9 deletions rocq-brick-libstdcpp/proof/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
(alias test_ast)
(deps (:input inc_cassert.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to inc_cassert_cpp.v.stderr (run cpp2v -v %{input} -o inc_cassert_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to inc_cassert_cpp.v.stderr (run cpp2v -v %{input} -o inc_cassert_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps inc_cassert.cpp))
)
(subdir cctype
Expand All @@ -14,7 +14,7 @@
(alias test_ast)
(deps (:input inc_cctype.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to inc_cctype_cpp.v.stderr (run cpp2v -v %{input} -o inc_cctype_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to inc_cctype_cpp.v.stderr (run cpp2v -v %{input} -o inc_cctype_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps inc_cctype.cpp))
)
(subdir cstdlib
Expand All @@ -23,7 +23,7 @@
(alias test_ast)
(deps (:input inc_cstdlib.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to inc_cstdlib_cpp.v.stderr (run cpp2v -v %{input} -o inc_cstdlib_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to inc_cstdlib_cpp.v.stderr (run cpp2v -v %{input} -o inc_cstdlib_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps inc_cstdlib.cpp))
)
(subdir mutex
Expand All @@ -32,7 +32,7 @@
(alias test_ast)
(deps (:input demo.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to demo_cpp.v.stderr (run cpp2v -v %{input} -o demo_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to demo_cpp.v.stderr (run cpp2v -v %{input} -o demo_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps demo.cpp))
)
(subdir mutex
Expand All @@ -41,7 +41,7 @@
(alias test_ast)
(deps (:input inc.hpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to inc_hpp.v.stderr (run cpp2v -v %{input} -o inc_hpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to inc_hpp.v.stderr (run cpp2v -v %{input} -o inc_hpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps inc.hpp))
)
(subdir mutex
Expand All @@ -50,7 +50,7 @@
(alias test_ast)
(deps (:input test.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to test_cpp.v.stderr (run cpp2v -v %{input} -o test_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to test_cpp.v.stderr (run cpp2v -v %{input} -o test_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps test.cpp))
)
(subdir new
Expand All @@ -59,7 +59,7 @@
(alias test_ast)
(deps (:input inc_new.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to inc_new_cpp.v.stderr (run cpp2v -v %{input} -o inc_new_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to inc_new_cpp.v.stderr (run cpp2v -v %{input} -o inc_new_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps inc_new.cpp))
)
(subdir semaphore
Expand All @@ -68,7 +68,7 @@
(alias test_ast)
(deps (:input inc.hpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to inc_hpp.v.stderr (run cpp2v -v %{input} -o inc_hpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to inc_hpp.v.stderr (run cpp2v -v %{input} -o inc_hpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps inc.hpp))
)
(subdir semaphore
Expand All @@ -77,6 +77,6 @@
(alias test_ast)
(deps (:input test.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to test_cpp.v.stderr (run cpp2v -v %{input} -o test_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to test_cpp.v.stderr (run cpp2v -v %{input} -o test_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps test.cpp))
)
2 changes: 1 addition & 1 deletion rocq-brick-libstdcpp/test/cpp2v-dune-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ outRule() {
if [ "$system" = 1 ]; then
universe=" (universe)"
fi
local cpp2v="cpp2v -v %{input} -o ${module}"
local cpp2v="cpp2v -v %{input} -o ${module} --no-elaborate"

if [ "$gen_names" = 1 ]; then
local names="${name}_${ext}_names.v"
Expand Down
105 changes: 102 additions & 3 deletions rocq-brick-libstdcpp/test/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
(alias test_ast)
(deps (:input test.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to test_cpp.v.stderr (run cpp2v -v %{input} -o test_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to test_cpp.v.stderr (run cpp2v -v %{input} -o test_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps test.cpp))
)
(subdir cstdlib
Expand All @@ -14,15 +14,114 @@
(alias test_ast)
(deps (:input test.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to test_cpp.v.stderr (run cpp2v -v %{input} -o test_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to test_cpp.v.stderr (run cpp2v -v %{input} -o test_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps test.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N12_area_cpp.v.stderr N12_area_cpp.v)
(alias test_ast)
(deps (:input N12_area.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N12_area_cpp.v.stderr (run cpp2v -v %{input} -o N12_area_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N12_area.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N1_hello_world_cpp.v.stderr N1_hello_world_cpp.v)
(alias test_ast)
(deps (:input N1_hello_world.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N1_hello_world_cpp.v.stderr (run cpp2v -v %{input} -o N1_hello_world_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N1_hello_world.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N3_input_cpp.v.stderr N3_input_cpp.v)
(alias test_ast)
(deps (:input N3_input.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N3_input_cpp.v.stderr (run cpp2v -v %{input} -o N3_input_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N3_input.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N4_sum_cpp.v.stderr N4_sum_cpp.v)
(alias test_ast)
(deps (:input N4_sum.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N4_sum_cpp.v.stderr (run cpp2v -v %{input} -o N4_sum_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N4_sum.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N4_sum_a_cpp.v.stderr N4_sum_a_cpp.v)
(alias test_ast)
(deps (:input N4_sum_a.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N4_sum_a_cpp.v.stderr (run cpp2v -v %{input} -o N4_sum_a_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N4_sum_a.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N5_swap_cpp.v.stderr N5_swap_cpp.v)
(alias test_ast)
(deps (:input N5_swap.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N5_swap_cpp.v.stderr (run cpp2v -v %{input} -o N5_swap_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N5_swap.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N5_swap_a_cpp.v.stderr N5_swap_a_cpp.v)
(alias test_ast)
(deps (:input N5_swap_a.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N5_swap_a_cpp.v.stderr (run cpp2v -v %{input} -o N5_swap_a_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N5_swap_a.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N6_print_sizeof_cpp.v.stderr N6_print_sizeof_cpp.v)
(alias test_ast)
(deps (:input N6_print_sizeof.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N6_print_sizeof_cpp.v.stderr (run cpp2v -v %{input} -o N6_print_sizeof_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N6_print_sizeof.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N8_ascii_value_cast_cpp.v.stderr N8_ascii_value_cast_cpp.v)
(alias test_ast)
(deps (:input N8_ascii_value_cast.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N8_ascii_value_cast_cpp.v.stderr (run cpp2v -v %{input} -o N8_ascii_value_cast_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N8_ascii_value_cast.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N8_ascii_value_printf_cpp.v.stderr N8_ascii_value_printf_cpp.v)
(alias test_ast)
(deps (:input N8_ascii_value_printf.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N8_ascii_value_printf_cpp.v.stderr (run cpp2v -v %{input} -o N8_ascii_value_printf_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N8_ascii_value_printf.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets iostream_cpp.v.stderr iostream_cpp.v)
(alias test_ast)
(deps (:input iostream.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to iostream_cpp.v.stderr (run cpp2v -v %{input} -o iostream_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps iostream.cpp))
)
(subdir new
(rule
(targets demo_cpp.v.stderr demo_cpp.v)
(alias test_ast)
(deps (:input demo.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to demo_cpp.v.stderr (run cpp2v -v %{input} -o demo_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to demo_cpp.v.stderr (run cpp2v -v %{input} -o demo_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps demo.cpp))
)
30 changes: 30 additions & 0 deletions rocq-brick-libstdcpp/test/geeks_for_geeks_examples/N12_area.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// C++ program to find area
// and perimeter of rectangle
#include<iostream>
using namespace std;

// Utility function
int areaRectangle(int a, int b)
{
int area = a * b;
return area;
}

int perimeterRectangle(int a, int b)
{
int perimeter = 2*(a + b);
return perimeter;
}

// Driver code
int main()
{
int a = 5;
int b = 6;
cout << "Area = " <<
areaRectangle(a, b) <<
endl;
cout << "Perimeter = " <<
perimeterRectangle(a, b);
return 0;
}
Loading