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
fcee8a87
Commit
fcee8a87
authored
9 years ago
by
Regis Blanc
Browse files
Options
Downloads
Patches
Plain Diff
finishing up verification section
parent
692c1524
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/verification.rst
+26
-0
26 additions, 0 deletions
doc/verification.rst
with
26 additions
and
0 deletions
doc/verification.rst
+
26
−
0
View file @
fcee8a87
...
...
@@ -184,11 +184,37 @@ that point (3) holds as well.
Array access safety
*******************
Leon generates verification conditions for the safety of array accesses. For
each array variable, Leon carries along a symbolic information on its length.
This information is used to prove that each expression used as an index in the
array is strictly smaller than that length. The expression is also checked to
be positive.
Pattern matching exhaustiveness
*******************************
Leon verifies that pattern matching is exhaustive. The regular Scala compiler
only considers the types of expression involved in pattern matching, but Leon
will consider information such as precondition to formally prove the
exhaustiveness of pattern matching.
As an example, the following code should issue a warning with Scala:
.. code-block:: scala
abstract class List
case class Cons(head: Int, tail: List) extends List
case object Nil extends List
def getHead(l: List): Int = {
require(!l.isInstanceOf[Nil])
l match {
case Cons(x, _) => x
}
}
But Leon will actually prove that the pattern matching is actually exhaustive,
relying on the given precondition.
Proving mathematical theorems with Leon
---------------------------------------
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