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
93088f64
"src/sphinx/gettingstarted.rst" did not exist on "0de006a64ddd5bc1ad2851c5c29c811ce608d10e"
Commit
93088f64
authored
10 years ago
by
Manos Koukoutos
Browse files
Options
Downloads
Patches
Plain Diff
Sets, Maps in library
parent
b4af9913
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/library.rst
+29
-0
29 additions, 0 deletions
doc/library.rst
with
29 additions
and
0 deletions
doc/library.rst
+
29
−
0
View file @
93088f64
...
...
@@ -268,3 +268,32 @@ in the object ``ListSpecs``:
+---------------------------------------------------------------+--------------------------------------------------------+
| ``scanVsFoldRight[A,B](l: List[A], z: B, f: (A,B) => B)`` | ``l.scanRight(f)(z).head == l.foldRight(f)(z)`` |
+---------------------------------------------------------------+--------------------------------------------------------+
Set[T], Map[T]
--------------
Leon uses its own Sets and Maps, which are defined in the ``leon.lang`` package.
However, these classes are are not implemented within Leon.
Instead, they are parsed into specialized trees.
Methods of these classes are mapped to specialized trees within SMT solvers.
For code generation, we rely on Java Sets and Maps.
The API of these classes is a subset of the Scala API and can be found
in the :ref:`purescala` section.
Additionally, the following functions for Sets are provided in the
``leon.collection`` package:
+-----------------------------------------------------------+-------------------------------------------+
| Function signature | Short description |
+===========================================================+===========================================+
| ``setToList[A](set: Set[A]): List[A]`` | Transforms the Set ``set`` into a List. |
+-----------------------------------------------------------+-------------------------------------------+
| ``setForall[A](set: Set[A], p: A => Boolean): Boolean`` | Tests whether predicate ``p`` holds |
| | for all elements of Set ``set``. |
+-----------------------------------------------------------+-------------------------------------------+
| ``setExists[A](set: Set[A], p: A => Boolean): Boolean`` | Tests whether predicate ``p`` holds |
| | for all elements of Set ``set``. |
+-----------------------------------------------------------+-------------------------------------------+
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