Documentation

GaudisCrypt.Logic.LensWriteNorm

Chains of lens writes in normal form #

lensWriteNorm (a simproc): two writes of the same lens are one, two writes of disjoint lenses in a fixed order. Used by sim's implications (Logic/ECSim.lean) and by stmt_swap's side goals (Logic/StmtSwap.lean): two chains of writes on the same state are equal once in normal form exactly when they write the same values to the same lenses.

A write X.set v s through a lens X (Setter.set (Lens.toSetter X) v s): (X, v, s).

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    The lens X as lensWriteNorm compares it: every subterm in reducible normal form (a variable is localVarLens n T or, once a rule has unfolded that abbrev, (varLens ⟨n, T, …⟩).intoLocal, its type T or ⟨n, T, …⟩.type) and its proofs erased (the slot's Nonempty and key proofs, which two occurrences of the same variable need not share).

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Chains of writes in normal form (EC's memory: what a run of assignments leaves): two writes of the same lens are one (Setter.set_set), two writes of disjoint lenses (Lens.Disjoint, by instance search) in a fixed order (Expr.lt of their lensKeys), swapped by Lens.Disjoint.commute when out of order. Two chains of writes on the same state are equal once in normal form exactly when they write the same values to the same lenses.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For