This module contains the implementation of the pre processing pass for handling enum inductive types.
The implementation:
- generates mappings from enum inductives occuring in the goal to sufficiently large
BitVec
and replaces equality on the enum inductives with equality on these mapping functions. - Constant folds these mappings if appropriate.
- Adds bounds on the values returned by the mappings if the size of the enum inductive does not fit into a power of two.
- Handles applications of these mappings to
ite
,cond
and basic match statements.
Equations
- Lean.Elab.Tactic.BVDecide.Frontend.Normalize.eqIffEnumToBitVecEqSuffix = "eq_iff_enumToBitVec_eq"
Equations
- Lean.Elab.Tactic.BVDecide.Frontend.Normalize.matchEqCondSuffix = "eq_cond_enumToBitVec"
Assuming that declName
is an enum inductive, construct a proof of
∀ (x y : declName) : x = y ↔ x.enumToBitVec = y.enumToBitVec
.
Equations
- One or more equations did not get rendered due to their size.
Assuming that declName
is an enum inductive, construct a proof of
∀ (x : declName) : x.enumToBitVec ≤ domainSize - 1
where domainSize
is the amount of
constructors of declName
.
Equations
- One or more equations did not get rendered due to their size.
Obtain a theorem that translates .match_x
applications on enum inductives to chains of cond
applications. If the specific .match_x
that this is being called on is unsupported throw an error.
Equations
- One or more equations did not get rendered due to their size.
This simproc should be set up to trigger on expressions of the form EnumInductive.enumToBitVec x
.
It will check if x
is a constructor and if that is the case constant fold it to the corresponding
BitVec
value.
Equations
- One or more equations did not get rendered due to their size.
- Lean.Elab.Tactic.BVDecide.Frontend.Normalize.enumToBitVecCtor ((Lean.Expr.const fn []).app (Lean.Expr.const arg [])) = pure Lean.Meta.Simp.Step.continue
- Lean.Elab.Tactic.BVDecide.Frontend.Normalize.enumToBitVecCtor e = pure Lean.Meta.Simp.Step.continue
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.