Alignment.bend checks
raw source on the hub · import bend-edit-distance@0.1.0.0/Alignment.bend as Alignment
2 imports
import Base import ./EdlibTypes.bend as E
Types
type Cell source · line 7 · raw
Data
Configured alignment uses the scalar recurrence. Only two score rows are retained; PATH also carries persistent, shared operation prefixes. The ordinary NW/DISTANCE API in main.bend keeps its Myers fast path.
Cell@score:U32 -> @start:Nat -> @operations:List<&2, 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Operation> -> Cell
type Location source · line 10 · raw
Data
Location@end:0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Coordinate -> @start:Nat -> Location
type Best source · line 13 · raw
Data
Best@score:U32 -> @locations:List<&2, Location> -> Best
Definitions
def pair_matches source · line 17 · raw
@pair:0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.EqualityPair -> @+a:Char -> @+b:Char -> Bool
Additional pairs are symmetric, with no transitive closure.
def equal source · line 23 · raw
@pairs:List<&2, 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.EqualityPair> -> @+a:Char -> @+b:Char -> Bool
def trace_step source · line 30 · raw
@operations:List<&2, 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Operation> -> @operation:0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Operation -> @tracing:Bool -> List<&2, 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Operation>
def extend source · line 38 · raw
@cell:Cell -> @cost:U32 -> @operation:0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Operation -> @tracing:Bool -> Cell
def prefer_cells source · line 43 · raw
@first:Cell -> @second:Cell -> @prefer:Bool -> Cell
def prefer source · line 52 · raw
@+first:Cell -> @+second:Cell -> Cell
Earliest optimal start reproduces Edlib's last reverse-SHW location. Equal starts retain above, left, diagonal priority for NW traceback.
def step source · line 58 · raw
@above:Cell -> @left:Cell -> @diagonal:Cell -> @+tracing:Bool -> @+matches:Bool -> Cell
def row_cells source · line 65 · raw
@columns:String -> @previous:List<&2, Cell> -> @diagonal:Cell -> @left:Cell -> @+symbol:Char -> @+pairs:List<&2, 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.EqualityPair> -> @+tracing:Bool -> List<&2, Cell>
def next_row source · line 77 · raw
@previous:List<&2, Cell> -> @columns:String -> @symbol:Char -> @pairs:List<&2, 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.EqualityPair> -> @tracing:Bool -> @+first:Cell -> List<&2, Cell>
def initial_cell source · line 86 · raw
@+mode:0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Mode -> @+index:U32 -> @operations:List<&2, 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Operation> -> Cell
def initial_row source · line 94 · raw
@columns:String -> @+mode:0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Mode -> @+index:U32 -> @+tracing:Bool -> @+operations:List<&2, 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Operation> -> List<&2, Cell>
def rows source · line 104 · raw
@query:String -> @+columns:String -> @previous:List<&2, Cell> -> @+pairs:List<&2, 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.EqualityPair> -> @+index:U32 -> @+tracing:Bool -> @+operations:List<&2, 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Operation> -> List<&2, Cell>
def scores source · line 115 · raw
@query:String -> @+target:String -> @mode:0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Mode -> @pairs:List<&2, 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.EqualityPair> -> @+tracing:Bool -> List<&2, Cell>
def last_cell source · line 120 · raw
@cells:List<&2, Cell> -> Cell
def update_best source · line 129 · raw
@best:Best -> @score:U32 -> @location:Location -> @comparison:Cmp -> Best
def collect source · line 138 · raw
@cells:List<&2, Cell> -> @+index:Nat -> @+best:Best -> Best
def ordered source · line 147 · raw
@best:Best -> Best
def nw_endpoint source · line 152 · raw
@cell:Cell -> @target_length:Nat -> Best
def semiglobal_endpoints source · line 157 · raw
@cells:List<&2, Cell> -> @include_before:Bool -> Best
def endpoints source · line 166 · raw
@cells:List<&2, Cell> -> @mode:0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Mode -> @target_length:Nat -> @query_length:Nat -> Best
def ends source · line 176 · raw
@locations:List<&2, Location> -> List<&2, 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Coordinate>
def starts source · line 183 · raw
@locations:List<&2, Location> -> List<&2, 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Coordinate>
def span source · line 190 · raw
@target:String -> @location:Location -> String
def path_result source · line 197 · raw
@score:U32 -> @+locations:List<&2, Location> -> @+operations:List<&2, 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Operation> -> @format:0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.CigarFormat -> 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.AlignResult
def path_cell source · line 202 · raw
@score:U32 -> @locations:List<&2, Location> -> @format:0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.CigarFormat -> @cell:Cell -> 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.AlignResult
def result source · line 208 · raw
@query:String -> @target:String -> @task:0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Task -> @pairs:List<&2, 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.EqualityPair> -> @format:0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.CigarFormat -> @best:Best -> @accepted:Bool -> 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.AlignResult
def finish source · line 224 · raw
@query:String -> @target:String -> @task:0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Task -> @threshold:0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.Threshold -> @pairs:List<&2, 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.EqualityPair> -> @format:0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.CigarFormat -> @+best:Best -> 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.AlignResult
def align source · line 233 · raw
@query:String -> @target:String -> @config:0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.AlignConfig -> 0x483ba00627509c62188f937a7cfd8f76/EdlibTypes.AlignResult
Pinned Edlib returns before applying k or calculating starts/path on empty inputs, including PATH. Preserve that observable oracle behavior.