You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/smtchecker.rst
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -412,7 +412,7 @@ is already "locked", so it would not be possible to change the value of ``x``,
412
412
regardless of what the unknown called code does.
413
413
414
414
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
416
416
that the assertion fails:
417
417
418
418
.. code-block:: text
@@ -518,6 +518,23 @@ which has the following form:
518
518
"source2.sol": ["contract2", "contract3"]
519
519
}
520
520
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.
0 commit comments