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
Return some className if n corresponds to a class or is transitively an abbrevation
to a class definition (e.g., DecidableEq, DecidableLT, DecidableRel, etc).
Equations
Instances For
Return true if e corresponds to a class constraint expression
(see function isClassConstraint).
Equations
- Blaster.Optimize.isClassConstraintExpr? e = match e.getAppFn' with | Lean.Expr.const n us => Blaster.Optimize.isClassConstraint? n | x => pure none
Instances For
- lctx : Lean.LocalContext
- localInsts : Lean.LocalInstances
Instances For
Equations
Instances For
Given type of the form forall xs, A, execute k xs A.
This combinator will declare local declarations, create free variables for them,
execute k with updated local context, and make sure the cache is restored after executing k.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Similar to forallTelescope, stops constructing the telescope when
it reaches size maxFVars.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given e of the form fun ..xs => A, execute k xs A.
This combinator will declare local declarations, create free variables for them,
execute k with updated local context, and make sure the cache is restored after executing k.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given e of the form fun ..xs ..ys => A, execute k xs (fun ..ys => A) where
xs.size ≤ maxFVars.
This combinator will declare local declarations, create free variables for them,
execute k with updated local context, and make sure the cache is restored after executing k.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Same as default withLocalDecl but rests heartbeats.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given e of the form λ (a₁ : α₁) → ... → λ (aₙ : αₙ) → b,
return λ (a₁ : α₁) → ... → λ (aₙ : αₙ) → f b.
NOTE: This function can be used only it is guaranteed the modifications induced by
f will not break the de-bruijn indices.
E.g.,
- f b ===> b * 2
- f b ===> b x₁ ... xₙ s.t., x₁ .. xₙ don't have any bounded variables.
- etc
Equations
Instances For
Given e of the form λ (a₁ : α₁) → ... → λ (aₙ : αₙ) → b,
return λ (a₁ : α₁) → f λ (aₖ : αₖ → ... → λ (aₙ : αₙ) where k < maxBinders
NOTE: This function can be used only it is guaranteed the modifications induced by
f will not break the de-bruijn indices.
E.g.,
- f b ===> b * 2
- f b ===> b x₁ ... xₙ s.t., x₁ .. xₙ don't have any bounded variables.
- etc
Equations
- Blaster.Optimize.applyOnLambdaBoundedBody e maxBinders f = Blaster.Optimize.applyOnLambdaBodyImp✝ e (some maxBinders) f
Instances For
Given a sequence of nested lambdas (a₁ : α₁) → ... → (aₙ : αₙ) → _, perform the following:
- let k = maxTypes
- return
#[α₁ ... αₖ]Note: Dependent types are instantiated (whenever necessary).
Equations
- Blaster.Optimize.getLambdaBoundedBinderTypes e maxTypes = Blaster.Optimize.getLambdaBinderTypesImp✝ e (some maxTypes)
Instances For
Given a sequence of nested lambdas (a₁ : α₁) → ... → (aₙ : αₙ) → _, return #[α₁ ... αₙ].
Note: Dependent types are instantiated (whenever necessary).
Instances For
Equations
Instances For
Return pInfo when f := pInfo ∈ getFunEnvInfoCache. Otherwise, performing the following
- Let v₁ : t₁ → .. → vₙ : tₙ := inferTypeEnv f
- Let p := #[ { binderInfo := declᵢ.binderInfo, isProp := ← isProp declᵢ.type } | ∀ i ∈ [1..n-1], declᵢ ← getFVarLocalDecl vᵢ ]
- Let pInfo := { paramsInfo := p, type := v₁ : t₁ → .. → vₙ : tₙ }
- add f := pInfo to
getFunEnvInfoCache - return pInfo
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given t := ∀ α₀ → ∀ α₂ → ... → αₙ corresponding to function type and x₁ ... xₘ the
function's applied arguments, determine the instantiated fun type by properly
instantiating the implicit arguments.
TODO: change function to pure tail rec call using stack-based approach
Equations
- Blaster.Optimize.inferFunType t args = Blaster.Optimize.inferFunType.visit args 0 args.size t
Instances For
Given t := ∀ α₀ → ∀ α₂ → ... → αₙ corresponding to function type and x₁ ... xₘ the
function's applied arguments, determine the application type by properly
instantiating the implicit arguments.
Equations
- Blaster.Optimize.inferAppType t args = Blaster.Optimize.inferAppType.visit args 0 args.size t
Instances For
Given a f : Expr.const n l a function name expression,
return true if f has at least one implicit argument.
Equations
- Blaster.Optimize.hasImplicitArgs f = do let fInfo ← Blaster.Optimize.getFunEnvInfo f pure (fInfo.paramsInfo.any fun (p : Blaster.Optimize.ParamInfo) => !p.isExplicit)
Instances For
Given application f x₀ ... xₙ, return the following sequence:
let A := [x₀ ... xₙ]
let instanceArgs := [ { implicitArg := A[i], isInstance := ¬ isExplicit A[i],
isGeneric := isGenericParam A[i], idxArg := i}
| i ∈ [0..n] ]
return instanceArgs
NOTE: It is also assumed that args does not contain any meta or bounded variables.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given function f and params its implicit parameter info (see getImplicitParameters),
perform the following:
let instanceArgs := [ params[i] | i ∈ [0..params.size-1] ∧ params[i].isInstance ]
let genFVars ← retrieveGenericFVars params
- When instanceArgs.isEmpty
- return
f
- return
- Otherwise:
- When instanceArgs.size == params.size (i.e., only implicit arguments provided)
- return
mkLambdaFVars genFVars f
- return
- Otherwise:
- return
mkLambdaFVars genFVars (specializeLambda (← etaExpand f) params)
- return
- When instanceArgs.size == params.size (i.e., only implicit arguments provided)
Equations
- One or more equations did not get rendered due to their size.