Documentation

DY.Bytes.Basic

@[instance_reducible]
instance DY.instRepresentable (SubF : Type → Type) [inst : SubBytesFunctor SubF] :
Equations
@[instance_reducible]
Equations
Instances
    @[irreducible]
    Equations
    Instances For
      @[instance_reducible]
      noncomputable instance DY.instSizeOfBytes [BytesFunctor] :
      Equations
      @[instance_reducible]
      Equations
      @[instance_reducible]
      Equations
      class DY.BytesFunctor.HasStep (SubF1 : Type → Type) (SubF2 : semiOutParam (Type → Type)) [SubBytesFunctor SubF1] [semiOutParam (SubBytesFunctor SubF2)] extends DY.ALaCarte.SubFunctor SubF1 SubF2 :
      Instances
        Instances
          @[instance_reducible]
          instance DY.BytesFunctor.instHasOfHasStep [BytesFunctor] (SubF1 SubF2 : Type → Type) [SubBytesFunctor SubF1] [SubBytesFunctor SubF2] [HasStep SubF1 SubF2] [Has SubF2] :
          Has SubF1
          Equations
          @[reducible, inline]
          abbrev DY.BytesFunctor.combine {n : Nat} (SubFs : Fin n → Type → Type) :
          Equations
          Instances For
            @[instance_reducible]
            instance DY.instSubBytesFunctorCombine {n : Nat} (SubFs : Fin n → Type → Type) [(id : Fin n) → SubBytesFunctor (SubFs id)] :
            Equations
            • One or more equations did not get rendered due to their size.
            @[instance_reducible]
            instance DY.instHasStepCombine {n : Nat} (SubFs : Fin n → Type → Type) [(id : Fin n) → SubBytesFunctor (SubFs id)] (id : Fin n) :
            Equations
            @[reducible, inline]
            abbrev DY.BytesView [BytesFunctor] (SubF : Type → Type) :
            Equations
            Instances For
              Equations
              Instances For
                Equations
                Instances For
                  theorem DY.Bytes.pack_view? [BytesFunctor] (SubF : Type → Type) [SubBytesFunctor SubF] [BytesFunctor.Has SubF] (b : Bytes) :
                  match b.view? SubF with | some bview => bview.pack = b | none => True
                  theorem DY.BytesView.view_pack [BytesFunctor] {SubF : Type → Type} [SubBytesFunctor SubF] [BytesFunctor.Has SubF] (b : BytesView SubF) :
                  b.pack.view? SubF = some b
                  theorem DY.Bytes.sizeOf_view [BytesFunctor] (SubF : Type → Type) [SubBytesFunctor SubF] [BytesFunctor.Has SubF] (b : Bytes) :
                  match b.view? SubF with | some bview => ALaCarte.FunctorSizeOf.sizeOf bview ≤ sizeOf b | none => True
                  @[reducible, inline]
                  Equations
                  Instances For
                    @[reducible, inline]
                    Equations
                    Instances For
                      def DY.Bytes.rec [BytesFunctor] {a : Type} (f : Function a) (x : Bytes) :
                      a
                      Equations
                      Instances For
                        class DY.Bytes.SubFunctionStep [BytesFunctor] {SubF1 SubF2 : Type → Type} {a : Type} [SubBytesFunctor SubF1] [SubBytesFunctor SubF2] [BytesFunctor.HasStep SubF1 SubF2] (partialFun1 : PartialFunction SubF1 a) (partialFun2 : semiOutParam (PartialFunction SubF2 a)) :
                        Instances
                          class DY.Bytes.SubFunction [BytesFunctor] {SubF : Type → Type} [SubBytesFunctor SubF] [BytesFunctor.Has SubF] {a : Type} (partialFun : PartialFunction SubF a) (totalFun : Function a) :
                          Instances
                            instance DY.instSubFunctionBytesF [BytesFunctor] {a : Type} (totalFun : Bytes.Function a) :
                            Bytes.SubFunction totalFun totalFun
                            instance DY.instSubFunctionOfSubFunctionStep [BytesFunctor] {SubF1 SubF2 : Type → Type} [SubBytesFunctor SubF1] [SubBytesFunctor SubF2] [BytesFunctor.HasStep SubF1 SubF2] [BytesFunctor.Has SubF2] {a : Type} (partialFun1 : Bytes.PartialFunction SubF1 a) (partialFun2 : Bytes.PartialFunction SubF2 a) (totalFun : Bytes.Function a) [Bytes.SubFunctionStep partialFun1 partialFun2] [Bytes.SubFunction partialFun2 totalFun] :
                            Bytes.SubFunction partialFun1 totalFun
                            def DY.Bytes.PartialFunction.combine [BytesFunctor] {n : Nat} {SubFs : Fin n → Type → Type} [(id : Fin n) → SubBytesFunctor (SubFs id)] {a : Type} (funs : (id : Fin n) → PartialFunction (SubFs id) a) :
                            Equations
                            Instances For
                              instance DY.instSubFunctionStepCombineCombine [BytesFunctor] {n : Nat} {SubFs : Fin n → Type → Type} [(id : Fin n) → SubBytesFunctor (SubFs id)] {a : Type} (funs : (id : Fin n) → Bytes.PartialFunction (SubFs id) a) (id : Fin n) :
                              theorem DY.Bytes.rec_eq [BytesFunctor] {SubF : Type → Type} [SubBytesFunctor SubF] [BytesFunctor.Has SubF] {a : Type} (partialFun : PartialFunction SubF a) (totalFun : Function a) [SubFunction partialFun totalFun] (x : BytesView SubF) :
                              rec totalFun x.pack = partialFun x fun (y : Bytes) (x : sizeOf y ≤ ALaCarte.FunctorSizeOf.sizeOf x) => rec totalFun y
                              def DY.Bytes.PartialProof1 [BytesFunctor] {SubF : Type → Type} [SubBytesFunctor SubF] {a : Type} (fn : PartialFunction SubF a) (rec : Bytes → a) (p : a → Prop) :
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def DY.Bytes.Proof1 [BytesFunctor] {a : Type} (fn : Function a) (p : a → Prop) :
                                Equations
                                Instances For
                                  theorem DY.Bytes.Proof1.prove [BytesFunctor] {a : Type} {fn : Function a} {p : a → Prop} (pf : Proof1 fn p) (x : Bytes) :
                                  p (rec fn x)
                                  theorem DY.Bytes.PartialProof1.combine [BytesFunctor] {n : Nat} {SubFs : Fin n → Type → Type} [(id : Fin n) → SubBytesFunctor (SubFs id)] {a : Type} {funs : (id : Fin n) → PartialFunction (SubFs id) a} {rec : Bytes → a} {p : a → Prop} (pfs : ∀ (id : Fin n), PartialProof1 (funs id) rec p) :
                                  def DY.Bytes.PartialProof2 [BytesFunctor] {SubF : Type → Type} [SubBytesFunctor SubF] {a b : Type} (fn1 : PartialFunction SubF a) (fn2 : PartialFunction SubF b) (rec1 : Bytes → a) (rec2 : Bytes → b) (p : a × b → Prop) :
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    def DY.Bytes.Proof2 [BytesFunctor] {a b : Type} (fn1 : Function a) (fn2 : Function b) (p : a × b → Prop) :
                                    Equations
                                    Instances For
                                      theorem DY.Bytes.Proof2.prove [BytesFunctor] {a b : Type} {fn1 : Function a} {fn2 : Function b} {p : a × b → Prop} (pf : Proof2 fn1 fn2 p) (x : Bytes) :
                                      p (rec fn1 x, rec fn2 x)
                                      theorem DY.Bytes.PartialProof2.combine [BytesFunctor] {n : Nat} {SubFs : Fin n → Type → Type} [(id : Fin n) → SubBytesFunctor (SubFs id)] {a b : Type} {funs1 : (id : Fin n) → PartialFunction (SubFs id) a} {funs2 : (id : Fin n) → PartialFunction (SubFs id) b} {rec1 : Bytes → a} {rec2 : Bytes → b} {p : a × b → Prop} (pfs : ∀ (id : Fin n), PartialProof2 (funs1 id) (funs2 id) rec1 rec2 p) :
                                      @[reducible, inline]
                                      Equations
                                      Instances For
                                        class DY.BytesLength.HasStep [BytesFunctor] {SubF1 SubF2 : Type → Type} [SubBytesFunctor SubF1] [SubBytesFunctor SubF2] [BytesFunctor.HasStep SubF1 SubF2] (partialLength1 : outParam (Bytes.PartialLength SubF1)) (partialLength2 : Bytes.PartialLength SubF2) extends DY.Bytes.SubFunctionStep partialLength1 partialLength2 :
                                        Instances
                                          @[reducible, inline]
                                          abbrev DY.Bytes.PartialLength.combine [BytesFunctor] {n : Nat} {SubFs : Fin n → Type → Type} [(id : Fin n) → SubBytesFunctor (SubFs id)] (lens : (id : Fin n) → PartialLength (SubFs id)) :
                                          Equations
                                          Instances For
                                            instance DY.BytesLength.instHasOfHasStep [BytesFunctor] [BytesLength] {SubF1 SubF2 : Type → Type} [SubBytesFunctor SubF1] [SubBytesFunctor SubF2] [BytesFunctor.HasStep SubF1 SubF2] [BytesFunctor.Has SubF2] (partialLen1 : Bytes.PartialLength SubF1) (partialLen2 : Bytes.PartialLength SubF2) [inst1 : HasStep partialLen1 partialLen2] [inst2 : Has partialLen2] :
                                            Has partialLen1
                                            instance DY.BytesLength.instHasStepCombineCombine [BytesFunctor] {n : Nat} (SubFs : Fin n → Type → Type) [(id : Fin n) → SubBytesFunctor (SubFs id)] (invs : (id : Fin n) → Bytes.PartialLength (SubFs id)) (id : Fin n) :
                                            @[simp]
                                            theorem DY.Bytes.length.eq [BytesFunctor] {SubF : Type → Type} [SubBytesFunctor SubF] [BytesFunctor.Has SubF] [BytesLength] {subLength : PartialLength SubF} [BytesLength.Has subLength] (b : BytesView SubF) :
                                            b.pack.length = subLength b fun (y : Bytes) (x : sizeOf y ≤ ALaCarte.FunctorSizeOf.sizeOf b) => y.length