Grind Goal API for Symbolic Simulation #
This module provides an API for building symbolic simulation engines and
verification condition generators on top of grind. It wraps Sym operations
to work with grind's Goal type, enabling users to carry grind state
through symbolic execution while using lightweight Sym operations for
the main loop.
Typical usage pattern #
let goal ← mkGoal mvarId
let .goal xs goal ← goal.introN 2 | failure
let .goal goal ← goal.simp methods | failure
let goal ← goal.internalizeAll
-- ... symbolic execution loop using goal.apply ...
let .closed ← goal.grind | failure
Design #
Operations like introN, apply, and simp run in SymM for performance.
internalize and grind run in GrindM to access the E-graph.
Creates a Goal from an MVarId, applying Sym preprocessing.
Preprocessing ensures the goal is compatible with Sym operations.
Equations
Instances For
- failed : IntrosResult
- goal (newDecls : Array FVarId) (goal : Goal) : IntrosResult
Instances For
Introduces num binders from the goal's target.
Equations
Instances For
Introduces binders with the specified names.
Equations
Instances For
- failed : ApplyResult
- goals (subgoals : List Goal) : ApplyResult
Instances For
Applies a backward rule, returning subgoals on success.
Equations
Instances For
- noProgress : SimpGoalResult
- closed : SimpGoalResult
- goal (goal : Goal) : SimpGoalResult
Instances For
Simplifies the goal using the given methods.
Equations
Instances For
Like simp, but returns the original goal unchanged when no progress is made.
Equations
Instances For
- failed (goal : Goal) : GrindResult
- closed : GrindResult
Instances For
Closes the goal if its target matches a hypothesis.
Returns true on success.