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
0f517bdf
Commit
0f517bdf
authored
8 years ago
by
Nicolas Voirol
Browse files
Options
Downloads
Patches
Plain Diff
SimpleSymbols for default symbol implementations
parent
a3c19dd2
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/inox/ast/SimpleSymbols.scala
+36
-0
36 additions, 0 deletions
src/main/scala/inox/ast/SimpleSymbols.scala
src/main/scala/inox/package.scala
+1
-32
1 addition, 32 deletions
src/main/scala/inox/package.scala
with
37 additions
and
32 deletions
src/main/scala/inox/ast/SimpleSymbols.scala
0 → 100644
+
36
−
0
View file @
0f517bdf
/* Copyright 2009-2016 EPFL, Lausanne */
package
inox
package
ast
trait
SimpleSymbols
{
self
:
Trees
=>
class
Symbols
(
val
functions
:
Map
[
Identifier
,
FunDef
],
val
adts
:
Map
[
Identifier
,
ADTDefinition
]
)
extends
AbstractSymbols
{
def
transform
(
t
:
TreeTransformer
)
=
new
Symbols
(
functions
.
mapValues
(
fd
=>
new
FunDef
(
fd
.
id
,
fd
.
tparams
,
// type parameters can't be transformed!
fd
.
params
.
map
(
vd
=>
t
.
transform
(
vd
)),
t
.
transform
(
fd
.
returnType
),
t
.
transform
(
fd
.
fullBody
),
fd
.
flags
)),
adts
.
mapValues
{
case
sort
:
ADTSort
=>
sort
case
cons
:
ADTConstructor
=>
new
ADTConstructor
(
cons
.
id
,
cons
.
tparams
,
cons
.
sort
,
cons
.
fields
.
map
(
t
.
transform
),
cons
.
flags
)
})
def
extend
(
functions
:
Seq
[
FunDef
]
=
Seq
.
empty
,
adts
:
Seq
[
ADTDefinition
]
=
Seq
.
empty
)
=
new
Symbols
(
this
.
functions
++
functions
.
map
(
fd
=>
fd
.
id
->
fd
),
this
.
adts
++
adts
.
map
(
cd
=>
cd
.
id
->
cd
)
)
}
}
This diff is collapsed.
Click to expand it.
src/main/scala/inox/package.scala
+
1
−
32
View file @
0f517bdf
...
...
@@ -41,41 +41,10 @@ package object inox {
}
}
object
trees
extends
ast
.
Trees
{
object
trees
extends
ast
.
Trees
with
ast
.
SimpleSymbols
{
object
deconstructor
extends
{
protected
val
s
:
trees.
type
=
trees
protected
val
t
:
trees.
type
=
trees
}
with
ast
.
TreeDeconstructor
class
Symbols
(
val
functions
:
Map
[
Identifier
,
FunDef
],
val
adts
:
Map
[
Identifier
,
ADTDefinition
]
)
extends
AbstractSymbols
{
def
transform
(
t
:
TreeTransformer
)
=
new
Symbols
(
functions
.
mapValues
(
fd
=>
new
FunDef
(
fd
.
id
,
fd
.
tparams
,
// type parameters can't be transformed!
fd
.
params
.
map
(
vd
=>
t
.
transform
(
vd
)),
t
.
transform
(
fd
.
returnType
),
t
.
transform
(
fd
.
fullBody
),
fd
.
flags
)),
adts
.
mapValues
{
case
sort
:
ADTSort
=>
sort
case
cons
:
ADTConstructor
=>
new
ADTConstructor
(
cons
.
id
,
cons
.
tparams
,
cons
.
sort
,
cons
.
fields
.
map
(
t
.
transform
),
cons
.
flags
)
})
def
extend
(
functions
:
Seq
[
FunDef
]
=
Seq
.
empty
,
adts
:
Seq
[
ADTDefinition
]
=
Seq
.
empty
)
=
new
Symbols
(
this
.
functions
++
functions
.
map
(
fd
=>
fd
.
id
->
fd
),
this
.
adts
++
adts
.
map
(
cd
=>
cd
.
id
->
cd
)
)
}
}
}
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