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
779c8453
Commit
779c8453
authored
12 years ago
by
Etienne Kneuss
Browse files
Options
Downloads
Patches
Plain Diff
Make sure all Expr are ==able
parent
9bdbf0e3
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
src/main/scala/leon/purescala/Trees.scala
+35
-0
35 additions, 0 deletions
src/main/scala/leon/purescala/Trees.scala
with
35 additions
and
0 deletions
src/main/scala/leon/purescala/Trees.scala
+
35
−
0
View file @
779c8453
...
...
@@ -113,6 +113,13 @@ object Trees {
class
MatchExpr
(
val
scrutinee
:
Expr
,
val
cases
:
Seq
[
MatchCase
])
extends
Expr
with
ScalacPositional
{
def
scrutineeClassType
:
ClassType
=
scrutinee
.
getType
.
asInstanceOf
[
ClassType
]
override
def
equals
(
that
:
Any
)
:
Boolean
=
(
that
!=
null
)
&&
(
that
match
{
case
t
:
MatchExpr
=>
t
.
scrutinee
==
scrutinee
&&
t
.
cases
==
cases
case
_
=>
false
})
override
def
hashCode
:
Int
=
scrutinee
.
hashCode
+
cases
.
hashCode
}
sealed
abstract
class
MatchCase
extends
Serializable
{
...
...
@@ -184,6 +191,13 @@ object Trees {
class
And
private
(
val
exprs
:
Seq
[
Expr
])
extends
Expr
with
FixedType
{
val
fixedType
=
BooleanType
override
def
equals
(
that
:
Any
)
:
Boolean
=
(
that
!=
null
)
&&
(
that
match
{
case
t
:
And
=>
t
.
exprs
==
exprs
case
_
=>
false
})
override
def
hashCode
:
Int
=
exprs
.
hashCode
}
object
Or
{
...
...
@@ -203,6 +217,13 @@ object Trees {
class
Or
(
val
exprs
:
Seq
[
Expr
])
extends
Expr
with
FixedType
{
val
fixedType
=
BooleanType
override
def
equals
(
that
:
Any
)
:
Boolean
=
(
that
!=
null
)
&&
(
that
match
{
case
t
:
Or
=>
t
.
exprs
==
exprs
case
_
=>
false
})
override
def
hashCode
:
Int
=
exprs
.
hashCode
}
object
Iff
{
...
...
@@ -221,6 +242,13 @@ object Trees {
class
Iff
(
val
left
:
Expr
,
val
right
:
Expr
)
extends
Expr
with
FixedType
{
val
fixedType
=
BooleanType
override
def
equals
(
that
:
Any
)
:
Boolean
=
(
that
!=
null
)
&&
(
that
match
{
case
t
:
Iff
=>
t
.
left
==
left
case
_
=>
false
})
override
def
hashCode
:
Int
=
left
.
hashCode
+
right
.
hashCode
}
object
Implies
{
...
...
@@ -242,6 +270,13 @@ object Trees {
// println("culprits: " + left.getType + ", " + right.getType)
// assert(false)
// }
override
def
equals
(
that
:
Any
)
:
Boolean
=
(
that
!=
null
)
&&
(
that
match
{
case
t
:
Iff
=>
t
.
left
==
left
case
_
=>
false
})
override
def
hashCode
:
Int
=
left
.
hashCode
+
right
.
hashCode
}
case
class
Not
(
expr
:
Expr
)
extends
Expr
with
FixedType
{
...
...
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