Handbook
Glossary
perfect-order? ( graph order -- ? )
Vocabulary
compiler
.
cfg
.
register-allocation
.
chordal
Inputs
graph
an
object
order
an
object
Outputs
?
an
object
Definition
USING:
assocs
kernel
math
sequences
;
IN:
compiler.cfg.register-allocation.chordal
::
perfect-order?
( graph order -- ? )
H{
}
clone
:>
seen graph
[
[
dup
]
H{
}
map>assoc
]
assoc-map
:>
neighbors 0
:>
index! order
[|
vertex |
vertex graph seen
earlier-neighbors
:>
earlier earlier
empty?
[
t
]
[
earlier
[
seen
at
]
maximum-by
:>
parent earlier
[|
neighbor |
neighbor parent
=
neighbor parent neighbors
at
key?
or
]
all?
]
if
index vertex seen
set-at
index 1
+
index!
]
all?
;