Documentation

DY.Bytes.Invariants

@[reducible, inline]
Equations
Instances For
    Equations
    Instances For
      Instances For
        Equations
        Instances For
          @[reducible, inline]
          Equations
          Instances For
            @[simp]
            theorem DY.Bytes.usage.eq [BytesFunctor] [ExecTraceTypes] [ProofTraceTypes] {SubF : Type → Type} [SubBytesFunctor SubF] [BytesFunctor.Has SubF] [GetUsage] {binv : PartialFunction SubF GetUsageT} [tc : GetUsage.Has binv] (b : BytesView SubF) (tr : ProofTrace) :
            b.pack.usage tr = binv b (fun (y : Bytes) (x : sizeOf y ≤ ALaCarte.FunctorSizeOf.sizeOf b) => y.usage) tr
            Equations
            Instances For
              @[reducible, inline]
              Equations
              Instances For
                @[simp]
                theorem DY.Bytes.label.eq [BytesFunctor] [ExecTraceTypes] [ProofTraceTypes] {SubF : Type → Type} [SubBytesFunctor SubF] [BytesFunctor.Has SubF] [GetLabel] {binv : PartialFunction SubF GetLabelT} [tc : GetLabel.Has binv] (b : BytesView SubF) (tr : ProofTrace) :
                b.pack.label tr = binv b (fun (y : Bytes) (x : sizeOf y ≤ ALaCarte.FunctorSizeOf.sizeOf b) => y.label) tr
                Equations
                Instances For
                  @[reducible, inline]
                  Equations
                  Instances For
                    Equations
                    Instances For

                      To reduce the boilerplate required to combine all (sub-)invariants, we bundle them into this structure, so that instead of having to combine each function separately, we can simply combine this bundle of functions. However, such a bundling prevents e.g. the definition of invariant to assume that well_formed is constructed in some particular way (e.g. that it contains some Pk invariants). Later on we will define properties on these (sub-)invariants: we do not bundle them here because in these proofs we want to be able to assume a particular implementation of well_formed.

                      Instances For
                        Instances
                          def DY.Bytes.PartialInvariants.combine [BytesFunctor] [ExecTraceTypes] [ProofTraceTypes] {n : Nat} {SubFs : Fin n → Type → Type} [(id : Fin n) → SubBytesFunctor (SubFs id)] (invs : (id : Fin n) → PartialInvariants (SubFs id)) :
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            theorem DY.Bytes.PartialInvariantsProofs.combine [BytesFunctor] [ExecTraceTypes] [ProofTraceTypes] [BytesInvariants] {n : Nat} {SubFs : Fin n → Type → Type} [(id : Fin n) → SubBytesFunctor (SubFs id)] {invs : (id : Fin n) → PartialInvariants (SubFs id)} (pfs : ∀ (id : Fin n), PartialInvariantsProofs (invs id)) :
                            instance DY.BytesInvariants.instHasOfHasStep [BytesFunctor] [ExecTraceTypes] [ProofTraceTypes] [BytesInvariants] {SubF1 SubF2 : Type → Type} [SubBytesFunctor SubF1] [SubBytesFunctor SubF2] [BytesFunctor.HasStep SubF1 SubF2] [BytesFunctor.Has SubF2] (partialInvs1 : Bytes.PartialInvariants SubF1) (partialInvs2 : Bytes.PartialInvariants SubF2) [inst1 : HasStep partialInvs1 partialInvs2] [inst2 : Has partialInvs2] :
                            Has partialInvs1
                            instance DY.BytesInvariants.instHasStepCombineCombine [BytesFunctor] [ExecTraceTypes] [ProofTraceTypes] [BytesInvariants] {n : Nat} (SubFs : Fin n → Type → Type) [(id : Fin n) → SubBytesFunctor (SubFs id)] (invs : (id : Fin n) → Bytes.PartialInvariants (SubFs id)) (id : Fin n) :
                            Equations
                            Instances For
                              theorem DY.Bytes.HasUsage_inj [BytesFunctor] [ExecTraceTypes] [ProofTraceTypes] [BytesWellFormed] [GetUsage] [GetLabel] (b : Bytes) (usg1 usg2 : Usage) (tr : ProofTrace) :
                              b.HasUsage usg1 tr → b.HasUsage usg2 tr → usg1 = usg2 ∨ (b.label tr).canFlow Label.pub (Trace.erase tr)
                              Equations
                              Instances For
                                Equations
                                Instances For
                                  Equations
                                  Instances For
                                    theorem DY.Bytes.xxxLabel_later [BytesFunctor] [ExecTraceTypes] [ProofTraceTypes] [BytesWellFormed] [GetLabel] [GetLabelLater] (extract : Bytes → Option Bytes) (h_extract : ExtractPreservesWellFormed extract) (b : Bytes) (tr1 tr2 : ProofTrace) :
                                    b.WellFormed tr1 → tr1 ≤ tr2 → xxxLabel extract b tr1 = xxxLabel extract b tr2
                                    theorem DY.Bytes.XXXHasUsage_later [BytesFunctor] [ExecTraceTypes] [ProofTraceTypes] [BytesWellFormed] [GetUsage] [GetUsageLater] [GetLabel] [GetLabelLater] (extract : Bytes → Option Bytes) (h_extract : ExtractPreservesWellFormed extract) (b : Bytes) (usg : Usage) (tr1 tr2 : ProofTrace) :
                                    b.WellFormed tr1 → tr1 ≤ tr2 → XXXHasUsage extract b usg tr1 → XXXHasUsage extract b usg tr2