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
ef8fad41
Commit
ef8fad41
authored
9 years ago
by
Manos Koukoutos
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug with comparison
parent
04ed37ac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/scala/leon/purescala/DefOps.scala
+3
-3
3 additions, 3 deletions
src/main/scala/leon/purescala/DefOps.scala
with
3 additions
and
3 deletions
src/main/scala/leon/purescala/DefOps.scala
+
3
−
3
View file @
ef8fad41
...
...
@@ -388,7 +388,7 @@ object DefOps {
}(
p
)
private
def
defaultCdMap
(
cc
:
CaseClass
,
ccd
:
CaseClassType
)
:
Option
[
Expr
]
=
(
cc
,
ccd
)
match
{
case
(
CaseClass
(
old
,
args
),
newCcd
)
if
old
.
classDef
!=
newCcd
=>
case
(
CaseClass
(
old
,
args
),
newCcd
)
if
old
.
classDef
!=
newCcd
.
classDef
=>
Some
(
CaseClass
(
newCcd
,
args
))
case
_
=>
None
...
...
@@ -401,7 +401,7 @@ object DefOps {
* @param ciMapF Given a previous case class invocation and its new case class definition, returns the expression to use.
* By default it is the case class construction using the new case class definition.
* @return the new program with a map from the old case classes to the new case classes, with maps concerning identifiers and function definitions. */
def
replaceCaseClassDefs
(
p
:
Program
)(
_
cdMapF
:
CaseClassDef
=>
Option
[
Option
[
AbstractClassType
]
=>
CaseClassDef
],
def
replaceCaseClassDefs
(
p
:
Program
)(
cdMapF
:
CaseClassDef
=>
Option
[
Option
[
AbstractClassType
]
=>
CaseClassDef
],
ciMapF
:
(
CaseClass
,
CaseClassType
)
=>
Option
[
Expr
]
=
defaultCdMap
)
:
(
Program
,
Map
[
ClassDef
,
ClassDef
],
Map
[
Identifier
,
Identifier
],
Map
[
FunDef
,
FunDef
])
=
{
var
cdMapFCache
=
Map
[
CaseClassDef
,
Option
[
Option
[
AbstractClassType
]
=>
CaseClassDef
]]()
...
...
@@ -413,7 +413,7 @@ object DefOps {
cd
match
{
case
ccd
:
CaseClassDef
=>
cdMapFCache
.
getOrElse
(
ccd
,
{
val
new_cd_potential
=
_
cdMapF
(
ccd
)
val
new_cd_potential
=
cdMapF
(
ccd
)
cdMapFCache
+=
ccd
->
new_cd_potential
new_cd_potential
})
...
...
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