compress-path ( source assoc -- destination )


Vocabulary
compiler.utilities

Inputs
sourcean integer
assocan assoc


Outputs
destinationan integer


Word description
Gets the original definer for a vreg number. Then inserts a direct path from 'source' to that definer. For example if the assoc is
{ { 1 2 } { 2 3 } { 3 4 } { 4 4 } }

then the original definer of 1 is 4. The word is used by leader to figure out what the top leader of a vreg is.

Definition


:: compress-path ( source assoc -- destination )
source assoc at :> destination source destination =
[ source ] [
destination assoc compress-path
:> destination' destination' destination =
[ destination' source assoc set-at ] unless destination'
] if ;