Fixed Parameter Static Analyzer #
- top: Lean.Compiler.LCNF.FixedParams.AbsValue
- erased: Lean.Compiler.LCNF.FixedParams.AbsValue
- val: Nat → Lean.Compiler.LCNF.FixedParams.AbsValue
Abstract value for the "fixed parameter" analysis.
Instances For
- decls : Array Lean.Compiler.LCNF.Decl
Declaration in the same mutual block.
- main : Lean.Compiler.LCNF.Decl
- assignment : Lean.FVarIdMap Lean.Compiler.LCNF.FixedParams.AbsValue
The assignment maps free variable ids in the current code being analyzed to abstract values. We only track the abstract value assigned to parameters.
Instances For
Set of calls that have been already analyzed. Recall that we assume that only functions in
declsmay have recursive calls to the function being analyzed (i.e.,main). Whenever there is function applicationf a₁ ... aₙ, wherefis indecls,fis notmain, and we visit with the abstract values assigned toaᵢ, but first we record the visit here.Bitmask containing the result, i.e., which parameters of
mainare fixed. We initialize it withtrueeverywhere.
Instances For
Monad for the fixed parameter static analyzer. We use the unit-exception to interrupt the analysis.
Equations
Instances For
Stop the analysis and mark all parameters as non-fixed.
Equations
Instances For
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
Equations
- Lean.Compiler.LCNF.FixedParams.inMutualBlock declName = do let __do_lift ← read pure (Array.any __do_lift.decls (fun x => x.name == declName) 0 (Array.size __do_lift.decls))
Instances For
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
Given the (potentially mutually) recursive declarations decls,
return a map from declaration name decl.name to a bit-mask m where m[i] is true
iff the decl.params[i] is a fixed argument. That is, it does not change in recursive
applications.
The function assumes that if a function f was declared in a mutual block, then decls
contains all (computationally relevant) functions in the mutual block.
Equations
- One or more equations did not get rendered due to their size.