Skip to content

Commit e2588a5

Browse files
author
Leo Alt
committed
Docs
1 parent 19fb7cf commit e2588a5

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

docs/smtchecker.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,23 @@ which has the following form:
518518
"source2.sol": ["contract2", "contract3"]
519519
}
520520
521+
Reported Inferred Inductive Invariants
522+
======================================
523+
524+
For properties that were proved safe with the CHC engine,
525+
the SMTChecker can retrieve inductive invariants that were inferred by the Horn
526+
solver as part of the proof.
527+
Currently two types of invariants can be reported to the user:
528+
529+
- Contract Invariants: these are properties over the contract's state variables
530+
that are true before and after every possible transaction that the contract may ever run. For example, ``x * y = k``.
531+
- Reentrancy Properties: they represent the behavior of the contract
532+
in the presence of external calls to unknown code. These properties can express a relation
533+
between the value of the state variables before and after the external call, where the external call is free to do anything, including making reentrant calls to the analyzed contract. Primed variables represent the state variables' values after said external call. Example: ``lock -> x = x'``.
534+
535+
The user can choose the type of invariants to be reported using the CLI option ``--model-checker-invariants "contract,reentrancy"`` or as an array in the field ``settings.modelChecker.invariants`` in the :ref:`JSON input<compiler-api>`.
536+
By default the SMTChecker does not report invariants.
537+
521538
Division and Modulo With Slack Variables
522539
========================================
523540

docs/using-the-compiler.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,8 @@ Input Description
407407
"divModWithSlacks": true,
408408
// Choose which model checker engine to use: all (default), bmc, chc, none.
409409
"engine": "chc",
410+
// Choose which types of invariants should be reported to the user: contract, reentrancy.
411+
"invariants": ["contract", "reentrancy"],
410412
// Choose whether to output all unproved targets. The default is `false`.
411413
"showUnproved": true,
412414
// Choose which solvers should be used, if available.

0 commit comments

Comments
 (0)