This module implements the LRAT trimming algorithm described in section 4 of "Faster LRAT Checking Than Solving with CaDiCaL" (https://drops.dagstuhl.de/storage/00lipics/lipics-vol271-sat2023/LIPIcs.SAT.2023.21/LIPIcs.SAT.2023.21.pdf).
The context used for trimming LRAT proofs.
- used : Lean.RBMap Nat Unit compare
The set of used proof step ids.
- mapped : Std.HashMap Nat Nat
A mapping from old proof step ids to new ones. Used such that the proof remains a sequence without gaps.
@[reducible, inline]
partial def
Lean.Elab.Tactic.BVDecide.LRAT.trim.M.findInitialId
(proof : Array Std.Tactic.BVDecide.LRAT.IntAction)
(curr : optParam Nat 0)
:
def
Lean.Elab.Tactic.BVDecide.LRAT.trim.M.findEmptyId
(proof : Array Std.Tactic.BVDecide.LRAT.IntAction)
:
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Tactic.BVDecide.LRAT.trim.M.run
{α : Type}
(proof : Array Std.Tactic.BVDecide.LRAT.IntAction)
(x : Lean.Elab.Tactic.BVDecide.LRAT.trim.M α)
:
Equations
- One or more equations did not get rendered due to their size.
@[inline]
Equations
- Lean.Elab.Tactic.BVDecide.LRAT.trim.M.getInitialId = do let ctx ← read pure ctx.initialId
@[inline]
Equations
- Lean.Elab.Tactic.BVDecide.LRAT.trim.M.getEmptyId = do let ctx ← read pure ctx.addEmptyId
@[inline]
Equations
- Lean.Elab.Tactic.BVDecide.LRAT.trim.M.getProofStep id = do let ctx ← read pure ctx.proof[id]?
@[inline]
Equations
- Lean.Elab.Tactic.BVDecide.LRAT.trim.M.isUsed id = do let s ← get pure (s.used.contains id)
@[inline]
Equations
- One or more equations did not get rendered due to their size.
@[inline]
Equations
- Lean.Elab.Tactic.BVDecide.LRAT.trim.M.getUsedSet = do let s ← get pure s.used
Equations
- Lean.Elab.Tactic.BVDecide.LRAT.trim.M.registerIdMap oldId newId = modify fun (s : Lean.Elab.Tactic.BVDecide.LRAT.trim.State) => { used := s.used, mapped := s.mapped.insert oldId newId }
Equations
- One or more equations did not get rendered due to their size.
@[inline]
Equations
- Lean.Elab.Tactic.BVDecide.LRAT.trim.M.mapStep.mapIdent ident = do let s ← get pure (s.mapped[ident]?.getD ident)
Perform a use-def analysis of LRAT proof steps, starting at the empty clause and working its way up with DFS.
Equations
Map the set of used proof steps to a new LRAT proof that has no holes in the sequence of proof identifiers.
Equations
- One or more equations did not get rendered due to their size.
Trim the LRAT proof
by removing all steps that are not used in reaching the empty clause
conclusion.