Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CERT-8156: split_rules documentation #345

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
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
21 changes: 21 additions & 0 deletions docs/prover/cli/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,27 @@ If `Bank.spec` includes the following properties:
If we want to skip both rules we could run
`certoraRun Bank.sol --verify Bank:Bank.spec --exclude_rule withdraw*`

(--split_rules)=
### `--split_rules <rule_name_pattern>`

**What does it do?**
Typically, all rules (after being filtered by `--rule` and `--exclude_rule`) are evaluated in a single activation of
rahav-certora marked this conversation as resolved.
Show resolved Hide resolved
the prover. With `--split_rules` the user can run specific rules each on a dedicated instance of the prover.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add an explanation about the return/console?
(the user will see multiple links to reports, and the final link will be to the dashboard)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

rahav-certora marked this conversation as resolved.
Show resolved Hide resolved

Note that you can specify this flag multiple times to denote several rules or rule patterns.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add:

**When to use it?**
This option is useful when some rule take a much longer time than the rest. Split the difficult rules to their own dedicated Prover jobs will give them more resources that will potentially reduce their chance to time out and will decrease the time to get the final job result for the less computationally intensive rules.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

**Example**
If `Bank.spec` includes the following properties:

`invariant address_zero_cannot_become_an_account()`
`rule withdraw_succeeds()`
`rule withdraw_fails()`

If we want to run the invariant on different prover instances we could run
rahav-certora marked this conversation as resolved.
Show resolved Hide resolved
`certoraRun Bank.sol --verify Bank:Bank.spec --split_rules address_zero_cannot_become_an_account`

The rest of the rules (`withdraw_succeeds` and `withdraw_fails`) will run together in a different prover activation
rahav-certora marked this conversation as resolved.
Show resolved Hide resolved

```{note}
When used together with the {ref}`--rule` flag the logic is to collect all rules
that pass the `--rule` flag(s) and then subtract from them all rules that match
Expand Down