/***************************** shift.lib *****************************/ component { in cond, opd[ n ] } shiftIf( n, p ) { out result[ n ] } begin path zero[ p ]; literal( p, 0 ) { out zero }; { in cond, opd[ n - p @ 0 ] zero opd } select( 1, n ) { out result }; end component { in shiftBy[ m ], opd[ n ] } shift( n, m ) { out result[ n ] } begin if m == 0 then { in opd } join( n ) { out result }; else path result1[ n ]; { in shiftBy[ m - 1 ], opd } shiftIf( n, 1 << ( m - 1 ) ) { out result1 }; { in shiftBy[ m - 1 @ 0 ], result1 } shift( n, m - 1 ) { out result }; end end