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
45046b42
Commit
45046b42
authored
10 years ago
by
Regis Blanc
Committed by
Etienne Kneuss
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
a more evolved intro
parent
736e690a
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/index.rst
+1
-1
1 addition, 1 deletion
doc/index.rst
doc/intro.rst
+43
-2
43 additions, 2 deletions
doc/intro.rst
with
44 additions
and
3 deletions
doc/index.rst
+
1
−
1
View file @
45046b42
...
...
@@ -12,8 +12,8 @@ Contents:
:maxdepth: 2
intro
installation
gettingstarted
installation
purescala
xlang
verification
...
...
This diff is collapsed.
Click to expand it.
doc/intro.rst
+
43
−
2
View file @
45046b42
Introduction
============
The Leon system is an automated system for verifying, repairing, and synthesizing functional Scala programs.
The Leon system is an automated system for verifying, repairing, and
synthesizing Scala programs.
Leon supports programs written in :ref:`purescala`, a purely functional subset of Scala.
Leon supports programs written in :ref:`Pure Scala <purescala>`, a purely
functional subset of Scala. The :ref:`XLang <xlang>` extension enables Leon to
work on a richer subset of Scala, including imperative features. From the
perspective of the end user, that distinction between the two sets of features
should be mostly meaningless, but it can help getting an intuition when trying
to prove difficult properties.
The :ref:`Pure Scala <purescala>` features are at the *core* of the Leon
system. They are considered as primitives and get a personalized treatment in
the solving algorithms of Leon. On the other hand, any feature introduced by
:ref:`XLang <xlang>` can be --- and is --- encoded into a mix of Pure Scala
concepts. However, they are more than just syntactic sugar --- some of those
features actually require significant modification of the original program.
Software Verification
---------------------
Leon started out as a program verifier for :ref:`Pure Scala <purescala>`. It
would collect a list of top level functions written in Pure Scala, and verifies
the *validity* of their *contracts*. Essentially, for each function,
it would prove that the postcondition always hold, assuming a given precondition does
hold. A simple example:
.. code-block:: scala
def factorial(n: Int): Int = {
require(n >= 0)
if(n == 0) 1 else n * factorial(n - 1)
} ensuring(res => res >= 0)
Leon generates a ``postcondition`` verification condition for the above
function, corresponding to the predicate parameter to the ``ensuring``
expression. It attempts to prove it using a combination of an internal
algorithm and external automated theorem proving. Leon will return one of the
following:
* The postcondition is `valid`. In that case, Leon was able to prove that for **any**
input to the function satisfiying the precondition, the postcondition will always hold.
* The postcondition is `invalid`. It means that Leon disproved the postcondition and
that there exists at least one input satisfying the precondition and such that the
postcondition does not hold. Leon will always return a concrete counterexample, very
useful when trying to understand why a function is not satisfying its contract.
* The postcondition is `unknown`. It means Leon is unable to prove or find a counterexample.
It usually happens after a timeout or an internal error in the external theorem prover.
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