Skip to content

Commit 3aa445a

Browse files
authored
Merge pull request #459 from Certora/yoav/assume-no-casting-overflow
document the CLI flag `assume_no_casting_overflow`
2 parents c2be1b8 + 7b21468 commit 3aa445a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/prover/cli/options.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,6 +2524,29 @@ _Configuration file_
25242524
```
25252525

25262526

2527+
(--assume_no_casting_overflow)=
2528+
## `assume_no_casting_overflow`
2529+
2530+
This option adds an implicit assumption to all Solidity casting operation. For example, if `int16(x)` appears in the Solidity code, then it is assumed that `x` is indeed in the valid range of `int16` at this point in the program.
2531+
2532+
Note that this flag may result in an underapproximation, i.e., it may result in the tool not checking some valid runs. That is because solidity does not revert on out-of-bounds casting operations. Therefore, it is important to use this option with caution.
2533+
2534+
**Example**
2535+
2536+
To assume Solidity casts do not overflow / underflow:
2537+
2538+
_Command line_
2539+
2540+
```sh
2541+
certoraRun proj.conf --assume_no_casting_overflow true
2542+
```
2543+
2544+
_Configuration file_
2545+
2546+
```json
2547+
"assume_no_casting_overflow": true
2548+
```
2549+
25272550
(--precise_bitwise_ops)=
25282551
## `precise_bitwise_ops`
25292552

0 commit comments

Comments
 (0)