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
bc1a6fc9
Commit
bc1a6fc9
authored
10 years ago
by
Emmanouil (Manos) Koukoutos
Committed by
Etienne Kneuss
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
TypeParameterDef.freshen, TypeParameter.freshen
parent
23e8b66e
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/Definitions.scala
+9
-1
9 additions, 1 deletion
src/main/scala/leon/purescala/Definitions.scala
src/main/scala/leon/purescala/TypeTrees.scala
+3
-1
3 additions, 1 deletion
src/main/scala/leon/purescala/TypeTrees.scala
with
12 additions
and
2 deletions
src/main/scala/leon/purescala/Definitions.scala
+
9
−
1
View file @
bc1a6fc9
...
@@ -45,7 +45,10 @@ object Definitions {
...
@@ -45,7 +45,10 @@ object Definitions {
}
}
/** A ValDef declares a new identifier to be of a certain type. */
/**
* A ValDef declares a new identifier to be of a certain type.
* When creating a new FunDef, its parameters should obey (id.getType == tp)
*/
case
class
ValDef
(
id
:
Identifier
,
tpe
:
TypeTree
)
extends
Definition
with
Typed
{
case
class
ValDef
(
id
:
Identifier
,
tpe
:
TypeTree
)
extends
Definition
with
Typed
{
self
:
Serializable
=>
self
:
Serializable
=>
...
@@ -103,6 +106,7 @@ object Definitions {
...
@@ -103,6 +106,7 @@ object Definitions {
case
class
TypeParameterDef
(
tp
:
TypeParameter
)
extends
Definition
{
case
class
TypeParameterDef
(
tp
:
TypeParameter
)
extends
Definition
{
def
subDefinitions
=
Seq
()
def
subDefinitions
=
Seq
()
def
freshen
=
TypeParameterDef
(
tp
.
freshen
)
val
id
=
tp
.
id
val
id
=
tp
.
id
setSubDefOwners
()
setSubDefOwners
()
}
}
...
@@ -460,6 +464,10 @@ object Definitions {
...
@@ -460,6 +464,10 @@ object Definitions {
def
translated
(
e
:
Expr
)
:
Expr
=
instantiateType
(
e
,
typesMap
,
paramsMap
)
def
translated
(
e
:
Expr
)
:
Expr
=
instantiateType
(
e
,
typesMap
,
paramsMap
)
/**
* Params will return ValDefs instantiated with the correct types
* For such a ValDef(id,tp) it may hold that (id.getType != tp)
*/
lazy
val
(
params
:
Seq
[
ValDef
],
paramsMap
:
Map
[
Identifier
,
Identifier
])
=
{
lazy
val
(
params
:
Seq
[
ValDef
],
paramsMap
:
Map
[
Identifier
,
Identifier
])
=
{
if
(
typesMap
.
isEmpty
)
{
if
(
typesMap
.
isEmpty
)
{
(
fd
.
params
,
Map
())
(
fd
.
params
,
Map
())
...
...
This diff is collapsed.
Click to expand it.
src/main/scala/leon/purescala/TypeTrees.scala
+
3
−
1
View file @
bc1a6fc9
...
@@ -60,7 +60,9 @@ object TypeTrees {
...
@@ -60,7 +60,9 @@ object TypeTrees {
case
object
UnitType
extends
TypeTree
case
object
UnitType
extends
TypeTree
case
object
CharType
extends
TypeTree
case
object
CharType
extends
TypeTree
case
class
TypeParameter
(
id
:
Identifier
)
extends
TypeTree
case
class
TypeParameter
(
id
:
Identifier
)
extends
TypeTree
{
def
freshen
=
TypeParameter
(
id
.
freshen
)
}
case
class
TupleType
(
val
bases
:
Seq
[
TypeTree
])
extends
TypeTree
{
case
class
TupleType
(
val
bases
:
Seq
[
TypeTree
])
extends
TypeTree
{
lazy
val
dimension
:
Int
=
bases
.
length
lazy
val
dimension
:
Int
=
bases
.
length
...
...
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