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
7d4bcf69
Commit
7d4bcf69
authored
9 years ago
by
Regis Blanc
Browse files
Options
Downloads
Patches
Plain Diff
generic prefold with context
parent
c7aea6cf
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
src/main/scala/leon/purescala/SubTreeOps.scala
+14
-1
14 additions, 1 deletion
src/main/scala/leon/purescala/SubTreeOps.scala
src/main/scala/leon/purescala/Types.scala
+1
-1
1 addition, 1 deletion
src/main/scala/leon/purescala/Types.scala
with
15 additions
and
2 deletions
src/main/scala/leon/purescala/SubTreeOps.scala
+
14
−
1
View file @
7d4bcf69
...
...
@@ -276,6 +276,19 @@ trait SubTreeOps[SubTree <: Tree] {
rec
(
e
,
c
)
}
def
preFoldWithContext
[
C
](
f
:
(
SubTree
,
C
)
=>
C
,
combiner
:
(
SubTree
,
C
,
Seq
[
C
])
=>
C
)
(
e
:
SubTree
,
c
:
C
)
:
C
=
{
def
rec
(
eIn
:
SubTree
,
cIn
:
C
)
:
C
=
{
val
ctx
=
f
(
eIn
,
cIn
)
val
Deconstructor
(
es
,
_
)
=
eIn
val
cs
=
es
.
map
{
rec
(
_
,
ctx
)
}
combiner
(
eIn
,
ctx
,
cs
)
}
rec
(
e
,
c
)
}
/*
* =============
* Auxiliary API
...
...
@@ -322,4 +335,4 @@ trait SubTreeOps[SubTree <: Tree] {
res
}
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
src/main/scala/leon/purescala/Types.scala
+
1
−
1
View file @
7d4bcf69
...
...
@@ -98,7 +98,7 @@ object Types {
assert
(
classDef
.
tparams
.
size
==
tps
.
size
)
def
fields
=
{
lazy
val
fields
=
{
val
tmap
=
(
classDef
.
tparams
zip
tps
).
toMap
if
(
tmap
.
isEmpty
)
{
classDef
.
fields
...
...
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