Equality and binary-indexed array access as ambient programs #
Formula variables and circuit wires are binary indices. Looking them up must not first expand the index to unary: a malformed index can be exponentially larger than its encoding. The programs here scan the supplied array and compare binary indices, so their bounds apply to malformed inputs as well.
Equations
- MIPRE.SAT.ArrayProg.finishEq s = (s.2 && List.isEmpty s.1)
Instances For
noncomputable def
MIPRE.SAT.ArrayProg.eqStepP :
Cost.PolyTimeFun ((Cost.BitStr × Bool) × Bool) (Cost.BitStr × Bool)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Exact equality of bit strings, including their lengths.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]
Equality of binary natural numbers, without unary expansion.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
noncomputable def
MIPRE.SAT.ArrayProg.getD
{α : Type u_1}
[Cost.SizedEncoding α]
(d : α)
:
Cost.PolyTimeFun (ℕ × List α) α
Read a binary-indexed array, returning the fixed default outside its bounds. The scan is bounded by the array length, independently of the magnitude of the index.
Equations
- One or more equations did not get rendered due to their size.