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 : TypeType} [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 : TypeType} [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] {t : Type} [DecidableEq t] [Ord t] [Std.LawfulEqOrd t] [Std.TransOrd t] {SubFs : tTypeType} [(id : t) → SubBytesFunctor (SubFs id)] (invs : (id : t) → 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] {t : Type} [DecidableEq t] [Ord t] [Std.LawfulEqOrd t] [Std.TransOrd t] {SubFs : tTypeType} [(id : t) → SubBytesFunctor (SubFs id)] {invs : (id : t) → PartialInvariants (SubFs id)} (pfs : ∀ (id : t), PartialInvariantsProofs (invs id)) :
                            instance DY.BytesInvariants.instHasOfHasStep [BytesFunctor] [ExecTraceTypes] [ProofTraceTypes] [BytesInvariants] {SubF1 SubF2 : TypeType} [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] {t : Type} [DecidableEq t] [Ord t] [Std.LawfulEqOrd t] [Std.TransOrd t] (SubFs : tTypeType) [(id : t) → SubBytesFunctor (SubFs id)] (invs : (id : t) → Bytes.PartialInvariants (SubFs id)) (id : t) :
                            Equations
                            Instances For
                              theorem DY.Bytes.HasUsage_inj [BytesFunctor] [ExecTraceTypes] [ProofTraceTypes] [BytesWellFormed] [GetUsage] [GetLabel] (b : Bytes) (usg1 usg2 : Usage) (tr : ProofTrace) :
                              b.HasUsage usg1 trb.HasUsage usg2 trusg1 = 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 : BytesOption Bytes) (h_extract : ExtractPreservesWellFormed extract) (b : Bytes) (tr1 tr2 : ProofTrace) :
                                    b.WellFormed tr1tr1 tr2xxxLabel extract b tr1 = xxxLabel extract b tr2
                                    theorem DY.Bytes.XXXHasUsage_later [BytesFunctor] [ExecTraceTypes] [ProofTraceTypes] [BytesWellFormed] [GetUsage] [GetUsageLater] [GetLabel] [GetLabelLater] (extract : BytesOption Bytes) (h_extract : ExtractPreservesWellFormed extract) (b : Bytes) (usg : Usage) (tr1 tr2 : ProofTrace) :
                                    b.WellFormed tr1tr1 tr2XXXHasUsage extract b usg tr1XXXHasUsage extract b usg tr2