def off.len_take

bend-osdev-bytes@0.1.1.0 · PROOF.bend:907

import bend-osdev-bytes@0.1.1.0/PROOF.bend as PROOF
import Base
import bend-osdev-bytes@0.1.1.0/bytes.bend as B

907def off.len_take(+n: Nat, ws: List<&2, B.OctByte>) -> {List.length(&2, B.OctByte, B.w8s.take(n, ws)) == Nat.min(n, List.length(&2, B.OctByte, ws)) : Nat}:
908  match n ws:
909    case 0n _:
910      {==}
911    case 1n+p Nil{}:
912      {==}
913    case 1n+p Con{x, t}:
914      Equal.cong(Nat, Nat, k => 1n+k, List.length(&2, B.OctByte, B.w8s.take(p, t)), Nat.min(p, List.length(&2, B.OctByte, t)), off.len_take(p, t))

Uses (7)

Used by (1)