Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LARA
inox
Commits
1820ce4f
Commit
1820ce4f
authored
10 years ago
by
Regis Blanc
Browse files
Options
Downloads
Patches
Plain Diff
start formal definition of verification
parent
3d23f6c2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/installation.rst
+1
-1
1 addition, 1 deletion
doc/installation.rst
doc/verification.rst
+30
-7
30 additions, 7 deletions
doc/verification.rst
with
31 additions
and
8 deletions
doc/installation.rst
+
1
−
1
View file @
1820ce4f
...
@@ -88,7 +88,7 @@ In any case, we recommend that you install both solvers separately and have
...
@@ -88,7 +88,7 @@ In any case, we recommend that you install both solvers separately and have
their binaries available in the ``$PATH``.
their binaries available in the ``$PATH``.
Since the default solver uses the native Z3 API, you will have to explicitly
Since the default solver uses the native Z3 API, you will have to explicitly
specify another solver if this native layer is not available
for
you. Check the
specify another solver if this native layer is not available
to
you. Check the
the ``--solvers`` command line option:
the ``--solvers`` command line option:
::
::
...
...
This diff is collapsed.
Click to expand it.
doc/verification.rst
+
30
−
7
View file @
1820ce4f
...
@@ -17,9 +17,9 @@ Verification conditions
...
@@ -17,9 +17,9 @@ Verification conditions
Given an input program, Leon generates individual verification conditions
Given an input program, Leon generates individual verification conditions
corresponding to different properties of the program. A program is correct if
corresponding to different properties of the program. A program is correct if
all of the generated verification conditions are `valid`. The validity of some
all of the generated verification conditions are
`
`valid`
`
. The validity of some
conditions depends on the validity of other conditions --- typically a
conditions depends on the validity of other conditions --- typically a
postcondition is `valid` assuming the precondition is `valid`.
postcondition is
`
`valid`
`
assuming the precondition is
`
`valid`
`
.
For each function, Leon attempts to verify its contract, if there is one. A
For each function, Leon attempts to verify its contract, if there is one. A
*contract* is the combination of a *precondition* and a *postcondition*. A
*contract* is the combination of a *precondition* and a *postcondition*. A
...
@@ -29,15 +29,38 @@ Preconditions and postconditions are annotations given by the user --- they are
...
@@ -29,15 +29,38 @@ Preconditions and postconditions are annotations given by the user --- they are
the secifications and hence cannot be infered by a tool and must be provided.
the secifications and hence cannot be infered by a tool and must be provided.
In addition to user-provided contracts, Leon will also generate a few safety
In addition to user-provided contracts, Leon will also generate a few safety
verification conditions of its own. It will check that any array accesses are
verification conditions of its own. It will check that all of the array
within proper bounds, and that pattern matching always cover all possible cases,
accesses are within proper bounds, and that pattern matching always covers all
even given complex precondition. The latter is different from the Scala compiler
possible cases, even given complex precondition. The latter is different from
check on pattern matching exhaustiveness, as Leon considers information provided
the Scala compiler checks on pattern matching exhaustiveness, as Leon considers
by (explicit or implicit) preconditions to the match expression.
information provided by (explicit or implicit) preconditions to the ``match``
expression.
Postconditions
Postconditions
**************
**************
One core concept in verification is to check the contract of functions. The most
important part in a contract is the postcondition. The postcondition specifies
the behaviour of the function. It takes into account the precondition and only
asserts the property of the output when the input satisfies the precondition.
Formally, we consider a function
.. code-block:: scala
def f(x: A): B = {
require(prec)
body
} ensuring(res => post)
where, ``prec`` is a boolean expression with free variables contained in
``{x}``, and ``post`` is a boolean expression with free variables contained in
``{x, res}``. The types of ``x`` and ``res`` are respectively ``A`` and ``B``.
Leon attempts to prove the following theorem:
::
forall x, prec(x) implies post(body(x), x)
Preconditions
Preconditions
*************
*************
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment