Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-compiler-and-rts
compiler
Commits
6cf7690f
Commit
6cf7690f
authored
Aug 14, 2001
by
Vincent Zweije
Browse files
Removed redundancy (history graph) in result of function findoccs
parent
b5f3f499
Changes
1
Hide whitespace changes
Inline
Side-by-side
sucl/extract.icl
View file @
6cf7690f
...
...
@@ -82,18 +82,18 @@ actualfold deltanodes rnfnodes foldarea self foldcont hist rule
list2
=
map
(
pairwith
(
findoccs
hist
rule
))
(
removeMembers
(
varlist
rgraph
[
rroot
])
(
varlist
rgraph
rargs
))
// list2: list combining every node with list of every instantiable history graph
list3
=
[(
rnode
,
hgraph
,
mapping
)
\\
(
rnode
,[
((
hroot
,
hgraph
),
mapping
)
:_])<-
list2
]
list3
=
[(
rnode
,
mapping
)
\\
(
rnode
,[
mapping
:_])<-
list2
]
// list3: list combining every instantiable node with first instantiable history graph
rgraph`
=
foldr
foldrec
rgraph
list3
where
foldrec
(
rnode
,
hgraph
,
mapping
)
=
updategraph
rnode
(
mapsnd
(
map
(
lookup
mapping
))
foldcont
)
where
foldrec
(
rnode
,
mapping
)
=
updategraph
rnode
(
mapsnd
(
map
(
lookup
mapping
))
foldcont
)
(
rgraph``
,
areas`
)
=
finishfold
foldarea
fixednodes
singlenodes
rroot
rgraph`
fixednodes
=
intersect
(
removeDup
(
argnodes
++
foldednodes
++
rnfnodes
))
(
varlist
rgraph`
[
rroot
])
singlenodes
=
intersect
deltanodes
(
varlist
rgraph`
[
rroot
])
argnodes
=
varlist
rgraph`
rargs
foldednodes
=
map
fst
3
list3
foldednodes
=
map
fst
list3
/*
> findoccs
...
...
@@ -125,12 +125,12 @@ findoccs ::
[(
pvar
,
Graph
sym
pvar
)]
(
Rule
sym
var
)
var
->
[
((
pvar
,
Graph
sym
pvar
),
[(
pvar
,
var
)]
)
]
->
[[(
pvar
,
var
)]]
|
==
var
&
==
pvar
findoccs
hist
rule
rnode
=
[
((
hroot
,
hgraph
),
mapping
)
=
[
mapping
\\
((
hroot
,
hgraph
),(
seen
,
mapping
,[]))<-
list1
// Find instantiable history rgraphs...
|
unshared
rnode
(
hroot
,
hgraph
)
mapping
// ...which don't have shared contents
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment