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
301ea497
Commit
301ea497
authored
10 years ago
by
Viktor Kuncak
Browse files
Options
Downloads
Patches
Plain Diff
doc: small crosscutting changes while tutoring sort
parent
459863da
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/options.rst
+2
-2
2 additions, 2 deletions
doc/options.rst
doc/purescala.rst
+7
-6
7 additions, 6 deletions
doc/purescala.rst
doc/tutorial.rst
+18
-11
18 additions, 11 deletions
doc/tutorial.rst
with
27 additions
and
19 deletions
doc/options.rst
+
2
−
2
View file @
301ea497
.. _cmdlineoptions:
.. _cmdlineoptions:
Command Line
Options
Command Line
============
========
============
Here is an overview of the command-line options that Leon recognizes:
Here is an overview of the command-line options that Leon recognizes:
...
...
This diff is collapsed.
Click to expand it.
doc/purescala.rst
+
7
−
6
View file @
301ea497
...
@@ -3,12 +3,13 @@
...
@@ -3,12 +3,13 @@
Pure Scala
Pure Scala
==========
==========
The input to Leon is a purely functional subset of Scala,
The input to Leon is a purely functional **subset** of Scala
which we call **Pure Scala**. Constructs specific for Leon
(http://www.scala-lang.org/), which we call
are defined inside Leon's libraries in package `leon` and
**Pure Scala**. Constructs specific for Leon are defined inside
its subpackages. Leon invokes standard `scalac` compiler on
Leon's libraries in package `leon` and its subpackages. Leon
the input file, then performs additional checks to ensure
invokes standard `scalac` compiler on the input file, then
that the given program belongs to Pure Scala.
performs additional checks to ensure that the given program
belongs to Pure Scala.
Pure Scala supports two kinds of top-level declarations:
Pure Scala supports two kinds of top-level declarations:
...
...
This diff is collapsed.
Click to expand it.
doc/tutorial.rst
+
18
−
11
View file @
301ea497
...
@@ -92,8 +92,8 @@ parameters, such as
...
@@ -92,8 +92,8 @@ parameters, such as
def test1 = sort2(30, 4)
def test1 = sort2(30, 4)
Hovering over
the definition of
test1 should display
Hovering over
`
test1
`
should display
the computed result
the computed tuple `(4,30)
`.
`(4,30)`. From :ref:`cmdlineoptions`, use `--eval
`.
This shows that Leon's evaluator can also execute `choose`
This shows that Leon's evaluator can also execute `choose`
constructs. In other words, it supports programming
constructs. In other words, it supports programming
...
@@ -136,16 +136,23 @@ Depending on the particular run, Leon may also produce a solution such as
...
@@ -136,16 +136,23 @@ Depending on the particular run, Leon may also produce a solution such as
This code performs some unnecessary case analysis, but still
This code performs some unnecessary case analysis, but still
satisfies our specification. In this case, the specification
satisfies our specification. In this case, the specification
is unambiguous, so all programs that
one can synthesize
of the program output
is unambiguous, so all programs that
compute the same results for all inputs.
one can synthesize
compute the same results for all inputs.
Defining
Unbounded List
s
Defining
Lists and Their Propertie
s
------------------------
------------------------
-----------
Let us now
consider sorting
of any
number of elements.
We next
consider sorting
an unbounded
number of elements.
For this purpose, we define the data structure of lists of
For this purpose, we define a data structure for lists of
(big) integers. Leon has a built-in data type of
integers. Leon has a built-in data type of parametric
polymorphic lists, see :ref:`Leon Library <library>`, but
lists, see :ref:`Leon Library <library>`, but here we define
here we define our own variant.
our own variant instead. We use a recursive algebraic data type
definition, expressed using Scala's **case classes**.
.. code-block:: scala
sealed abstract class List
case object Nil extends List
case class Cons(head: BigInt, tail: List) extends List
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