@[inline]
Given e := Expr.fVar fv perform the following:
- When
some v := fv.getValue?returnSum.inl (.InitOptimizeExpr v :: stack)` - Otherwise:
returnstackContinuity stack (← mkExpr e)`
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
Given a function f := Expr const n l perform the following:
- When
n := mInfo ∈ isMatcherCache(i.e., match info already optimized)- return
none
- return
- When let some mInfo ← getMatcherRecInfo? n l (i.e., f's generic instance not optimized)
- return
some $ Sum.inr (mInfo, matchFun)
- return
- Otherwise
none
Equations
Instances For
@[inline]
Equations
Instances For
@[inline]
def
Blaster.Optimize.optimizeExprAux.optimizeLambda
(n : Lean.Name)
(t b : Lean.Expr)
(bi : Lean.BinderInfo)
(xs : List OptimizeStack)
(inDite : Bool := false)
:
Equations
- Blaster.Optimize.optimizeExprAux.optimizeLambda n t b bi xs inDite = Blaster.Optimize.OptimizeStack.InitOptimizeExpr t :: Blaster.Optimize.OptimizeStack.LambdaWaitForType n bi b inDite :: xs
Instances For
@[inline]
Equations
- Blaster.Optimize.optimizeExprAux.optimizeDiteArg (Lean.Expr.lam n t b bi) stack = Blaster.Optimize.optimizeExprAux.optimizeLambda n t b bi stack true
- Blaster.Optimize.optimizeExprAux.optimizeDiteArg e stack = Blaster.Optimize.OptimizeStack.InitOptimizeExpr e :: stack
Instances For
@[inline]
def
Blaster.Optimize.optimizeExprAux.optimizeExplicitArgs
(f : Lean.Expr)
(args : Array Lean.Expr)
(idx stopIdx : Nat)
(pInfo : FunEnvInfo)
(mInfo : Option MatchInfo)
(stack nxtStack : List OptimizeStack)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
Equations
Instances For
@[inline]
Same as optimizeExpr but updates local context before optimizing expression
Equations
- One or more equations did not get rendered due to their size.
Instances For
Populate the recFunInstCache with opaque recursive function definition.
This function need to be call before performing optimization on a lean expression.
NOTE: This function need to be updated each time we are opacifying a new recursive function.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Perform the following actions:
- populate the recFunInstCache with default recursive function definitions.
- optimize expression
e
Equations
- One or more equations did not get rendered due to their size.
Instances For
Optimize an expression using the given solver options.
Parameters #
sOpts: The solver options to use for optimization.expr: The expression to be optimized.
Returns #
- A tuple containing the optimized expression and the optimization environment. NOTE: This function is to be used only by callOptimize in package Test.
Equations
- One or more equations did not get rendered due to their size.