Myers.expand_semiglobal: def of bend-edit-distance@0.2.2.0 Import: import bend-edit-distance@0.2.2.0/src/Myers.bend as Myers Lines 505-515 of bend-edit-distance@0.2.2.0/src/Myers.bend: https://jend.leeeet.dev/read.txt?path=bend-edit-distance@0.2.2.0/src/Myers.bend&start_line=505&end_line=515 import Base import bend-edit-distance@0.2.2.0/EdlibTypes.bend as E def expand_semiglobal(updated: UpdatedBand, rest: List<&2, Peq>, +symbol: U32, mode: E.Mode, +maximum: Nat) -> Band: match updated rest: case UpdatedBand{entries, +score, Carry{+positive, +negative}, _} +profile <> tail: +previous = U32.sub(U32.add(score, negative), positive) +eq = peq_get(profile, symbol, U32.is_ne(U32.and(symbol, 1), 0)) expand_semiglobal.choose(entries, profile, tail, previous, eq, Carry{positive, negative}, mode, maximum, Bool.and(Nat.is_le(U32.to_nat(previous), maximum), Bool.or(U32.is_ne(U32.and(eq, 1), 0), U32.is_ne(negative, 0)))) case UpdatedBand{entries, _, _, _} Nil{}: reduce_semiglobal(trim_semiglobal(entries, Nil{}, mode, 0n, maximum)) Uses (20): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_ne https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bend-edit-distance@0.2.2.0/EdlibTypes.bend&name=Mode https://jend.leeeet.dev/definition.txt?path=bend-edit-distance@0.2.2.0/src/Myers.bend&name=Band https://jend.leeeet.dev/definition.txt?path=bend-edit-distance@0.2.2.0/src/Myers.bend&name=Carry https://jend.leeeet.dev/definition.txt?path=bend-edit-distance@0.2.2.0/src/Myers.bend&name=Peq https://jend.leeeet.dev/definition.txt?path=bend-edit-distance@0.2.2.0/src/Myers.bend&name=UpdatedBand https://jend.leeeet.dev/definition.txt?path=bend-edit-distance@0.2.2.0/src/Myers.bend&name=expand_semiglobal.choose https://jend.leeeet.dev/definition.txt?path=bend-edit-distance@0.2.2.0/src/Myers.bend&name=peq_get https://jend.leeeet.dev/definition.txt?path=bend-edit-distance@0.2.2.0/src/Myers.bend&name=reduce_semiglobal https://jend.leeeet.dev/definition.txt?path=bend-edit-distance@0.2.2.0/src/Myers.bend&name=trim_semiglobal