Skip to content

Commit

Permalink
Feature/foundry to kontrol (#17)
Browse files Browse the repository at this point in the history
* Move to intall-kontrol action and run kontrol intead of foundry

* Fix bash script run-kontrol.sh bugs

* Run on pull request

Co-authored-by: Palina Tolmach <[email protected]>

* Adding new git submodule to track kontrol cheatcodes repository

* Updating ReadME documentation, run-kontrol script formatting and steps to follow the README example more closely. Adding some media files for Example showing

* Fixing table of contents for quick links in docs

* Upgrade install-kontrol to latest version, installs forge / foundry as part of kontrol action

---------

Co-authored-by: rv-jenkins <[email protected]>
Co-authored-by: Palina Tolmach <[email protected]>
  • Loading branch information
3 people authored Apr 3, 2024
1 parent bb9586b commit 498529c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
submodules: recursive

- name: Install Kontrol
uses: runtimeverification/[email protected].0
uses: runtimeverification/[email protected].1
with:
version: latest

Expand Down
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,25 @@ However, they should be reproducible on Windows using the [Windows Subsystem for
<span style="color:red">Note that the instructions are for linux systems.</span>


# Table of Content
# Table of Contents
- [Highlights](#highlights)
- [Machine Setup](#machine-setup)
- [Installing Foundry](#installing-foundry)
- [Installing KONTROL](#installing-kontrol)
- [Repository contents](#repository-contents)
- [Test Breakdown](#test-breakdown)
- [Property Testing Using Foundry](#property-testing-using-foundry)



- [Contracts](#contracts)
- [Tests](#tests)
- [Property Testing Using Foundry ( Forge )](#property-testing-using-foundry--forge-)
- [Build with Forge](#build-with-forge)
- [Run Tests with Foundry](#run-tests-with-foundry)
- [Property Verification using KEVM ( Kontrol )](#property-verification-using-kevm--kontrol-)
- [Build with kontrol](#build-with-kontrol)
- [Run the Proofs](#run-the-proofs)
- [Insights by Kontrol](#insights-by-kontrol)
- [Kontrol List](#kontrol-list)
- [Kontrol View](#kontrol-view)

# Machine Setup

Installing Foundry
Expand Down Expand Up @@ -93,16 +105,13 @@ In the [`test`](./test) subdirectory, you will find tests of varying difficulty:
- `token.t.sol`: Tests of `token.sol`.
- `exclusiveToken.t.sol`: Tests of `exclusiveToken.t.sol`.

Property Testing Using Foundry
------------------------------
# Property Testing Using Foundry ( Forge )

We will use foundry for:

- Building the project (i.e. compiling the files), and
- Running the property tests on randomized inputs.

# Build the Project (Kontrol / Forge)

Build with Forge
----------------

Expand Down Expand Up @@ -205,8 +214,6 @@ For example:
Core(s) per socket: 4
Socket(s): 1
```
<span style="color:red">Better suggestions? ^^</span>

# Insights by Kontrol

Kontrol List
Expand Down
10 changes: 5 additions & 5 deletions run-kontrol.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ kontrol_section_edge() {
kontrol_build --require lemmas.k --module-import ERC20:DEMO-LEMMAS --verbose
kontrol_list
kontrol_prove -j8 \
--verbose \
--bug-report=BUGREPORT.bug \
--match-test Examples.test_assert_bool_failing
# --match-test Examples.test_assert_bool_passing\
--match-test Examples.test_assert_bool_failing \
--match-test Examples.test_assert_bool_passing
# --match-test Examples.test_wmul_increasing_overflow\
# --match-test Examples.test_wmul_increasing\
# --match-test Examples.test_wmul_increasing_positive\
Expand Down Expand Up @@ -92,8 +91,9 @@ kontrol_show --verbose
################
# Modify Nodes #
################
kontrol_remove_node 4b6c47..d6d6d3
kontrol_prove --reinit
# kontrol_remove_node 4b6c47..d6d6d3
# kontrol_prove --reinit


##############################
# Additional Reinit Examples #
Expand Down

0 comments on commit 498529c

Please sign in to comment.