Source/Packages

Data.Bytes

packages/foundation/standard/src/Data/Bytes.alpha

1,218 lines172 declarations47.4 KiBSHA-256 beded7f8a171

def · lines 568–583

dataBytesBuilderMetadataValid

Full file
Valid builders have no empty chunks and partition their length into shared source bytes and bytes copied while preparing bounded slices.
568def dataBytesBuilderMetadataValid =
569  (lambda unrestricted length : Nat .
570    unrestricted chunks : Nat .
571    unrestricted sharedBytes : Nat .
572    unrestricted preparationCopiedBytes : Nat .
573    nat-eliminate
574      (lambda unrestricted current : Nat . Nat)
575      0
576      (lambda unrestricted basicPredecessor : Nat . unrestricted basicInduction : Nat .
577        nat-eliminate
578          (lambda unrestricted current : Nat . Nat)
579          0
580          (lambda unrestricted sumPredecessor : Nat . unrestricted sumInduction : Nat .
581            naturalEqual (naturalAdd sharedBytes preparationCopiedBytes) length)
582          (naturalLessOrEqual preparationCopiedBytes (naturalSaturatingSubtract length sharedBytes)))
583      (naturalAnd (naturalLessOrEqual chunks length) (naturalLessOrEqual sharedBytes length)))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.