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
20e7d747
Commit
20e7d747
authored
10 years ago
by
Viktor Kuncak
Browse files
Options
Downloads
Patches
Plain Diff
writing on pure scala
parent
0dd73d24
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/purescala.rst
+16
-9
16 additions, 9 deletions
doc/purescala.rst
with
16 additions
and
9 deletions
doc/purescala.rst
+
16
−
9
View file @
20e7d747
.. _purescala:
Pure Scala: Leon's
Core Input
Language
===========================
===========
Pure Scala: Leon's Language
===========================
The input to Leon is a purely functional subset of Scala,
which we call **Pure Scala**. Constructs specific for Leon
are defined inside Leon's libraries in package `leon` and
its subpackages. Leon invokes standard `scalac` compiler on
the input file, then performs additional checks to ensure
that the given program belongs to Pure Scala.
Leon
supports two kinds of top-level declarations:
Pure Scala
supports two kinds of top-level declarations:
1. ADT definitions in the form of an abstract class and case classes/objects
1. Algebraic Data Type (ADT) definitions in the form of an
abstract class and case classes/objects
.. code-block:: scala
abstract class
Foo
case
class Bar(a: Int)
extends
Foo
case
object Gee
extends
Foo
abstract class
MyList
case
object MyEmpty
extends
MyList
case
class MyCons(elem: BigInt, rest: MyList)
extends
MyList
2. Objects/modules, for grouping classes and functions
.. code-block:: scala
object Specs {
def
foo
(a: Int) = {
def
increment
(a:
Big
Int)
: BigInt
= {
a + 1
}
case class
Foo(a:
Int)
case class
Identifier(id: Big
Int)
}
...
...
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