Skip to content

Commit 1a878a6

Browse files
author
Leo Alt
committed
Docs
1 parent 87f102f commit 1a878a6

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

docs/smtchecker.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ is already "locked", so it would not be possible to change the value of ``x``,
412412
regardless of what the unknown called code does.
413413

414414
If we "forget" to use the ``mutex`` modifier on function ``set``, the
415-
SMTChecker is able to synthesize the behavior of the externally called code so
415+
SMTChecker is able to synthesize the behaviour of the externally called code so
416416
that the assertion fails:
417417

418418
.. code-block:: text
@@ -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``, where ``x`` and ``y`` are a contract's state variables.
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
@@ -418,6 +418,8 @@ Input Description
418418
"divModWithSlacks": true,
419419
// Choose which model checker engine to use: all (default), bmc, chc, none.
420420
"engine": "chc",
421+
// Choose which types of invariants should be reported to the user: contract, reentrancy.
422+
"invariants": ["contract", "reentrancy"],
421423
// Choose whether to output all unproved targets. The default is `false`.
422424
"showUnproved": true,
423425
// Choose which solvers should be used, if available.

0 commit comments

Comments
 (0)