def adaptive_search
bend-edit-distance@0.2.2.0 · src/Myers.bend:407
import bend-edit-distance@0.2.2.0/src/Myers.bend as Myers
import Base
import bend-edit-distance@0.2.2.0/EdlibTypes.bend as E
407def adaptive_search(fuel: Nat, +target: String, +profiles: List<&2, Peq>,
408 +length: Nat, +target_length: Nat, +maximum: Nat,
409 +padding: Nat, +blocks: Nat, +columns: Nat,
410 +attempts: Nat) -> Search:
411 match fuel:
412 case 0n:
413 Search{E.NotFound{}, blocks, columns, attempts}
414 case 1n+p:
415 adaptive_search.result(band_attempt(target, profiles, length, target_length, maximum, padding),
416 blocks, columns, attempts, bs => cs =>
417 adaptive_search(p, target, profiles, length, target_length,
418 Nat.min(target_length, Nat.mul(maximum, 2n)), padding, bs, cs, 1n+attempts))