Value used in the abstract interpreter
- bot : Value
- top : Value
- ctor (i : CtorInfo) (vs : Array Value) : Value
- choice (vs : List Value) : Value
Instances For
- Lean.IR.UnreachableBranches.Value.instBEq
- Lean.IR.UnreachableBranches.Value.instToFormat
- Lean.IR.UnreachableBranches.Value.instToString
- Lean.IR.UnreachableBranches.instInhabitedValue
- Lean.IR.UnreachableBranches.instReprValue
- Lean.IR.UnreachableBranches.instToFormatValue
- Lean.IR.UnreachableBranches.instToStringValue
Equations
Equations
Equations
- Lean.IR.UnreachableBranches.instToStringValue = { toString := fun (v : Lean.IR.UnreachableBranches.Value) => toString (Std.format v) }
Equations
Equations
- Lean.IR.UnreachableBranches.Value.instToString = { toString := (fun (f : Std.Format) => f.pretty) ∘ Lean.IR.UnreachableBranches.Value.format }
In truncate
, we approximate a value as top
if depth > truncateMaxDepth
.
TODO: add option to control this parameter.
Make sure constructors of recursive inductive datatypes can only occur once in each path.
Values at depth > truncateMaxDepth are also approximated at top
.
We use this function this function to implement a simple widening operation for our abstract
interpreter.
Recall the widening functions is used to ensure termination in abstract interpreters.
partial def
Lean.IR.UnreachableBranches.Value.truncate.go
(env : Environment)
(v : Value)
(s : NameSet)
(depth : Nat)
:
Widening operator that guarantees termination in our abstract interpreter.
Equations
- Lean.IR.UnreachableBranches.Value.widening env v₁ v₂ = Lean.IR.UnreachableBranches.Value.truncate env (v₁.merge v₂) ∅
@[reducible, inline]
Equations
Equations
- One or more equations did not get rendered due to their size.
@[reducible, inline]
- currFnIdx : Nat
- env : Environment
- lctx : LocalContext
- assignments : Array Assignment
@[reducible, inline]
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
- Lean.IR.UnreachableBranches.interpExpr (Lean.IR.Expr.proj i x_1) = do let __do_lift ← Lean.IR.UnreachableBranches.findVarValue x_1 pure (Lean.IR.UnreachableBranches.projValue __do_lift i)
- Lean.IR.UnreachableBranches.interpExpr x✝ = pure Lean.IR.UnreachableBranches.Value.top
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.UnreachableBranches.elimDead assignment (Lean.IR.Decl.fdecl f xs type b info) = (Lean.IR.Decl.fdecl f xs type b info).updateBody! (Lean.IR.UnreachableBranches.elimDeadAux assignment b)
- Lean.IR.UnreachableBranches.elimDead assignment d = d