Documentation
Lean
.
Util
.
CollectFVars
Search
return to top
source
Imports
Lean.Expr
Lean.LocalContext
Imported by
Lean
.
CollectFVars
.
State
Lean
.
CollectFVars
.
instInhabitedState
Lean
.
CollectFVars
.
State
.
add
Lean
.
CollectFVars
.
Visitor
Lean
.
CollectFVars
.
visit
Lean
.
CollectFVars
.
main
Lean
.
collectFVars
source
structure
Lean
.
CollectFVars
.
State
:
Type
visitedExpr :
ExprSet
fvarSet :
FVarIdSet
fvarIds :
Array
FVarId
Instances For
source
instance
Lean
.
CollectFVars
.
instInhabitedState
:
Inhabited
State
Equations
Lean.CollectFVars.instInhabitedState
=
{
default
:=
{
visitedExpr
:=
default
,
fvarSet
:=
default
,
fvarIds
:=
default
}
}
source
def
Lean
.
CollectFVars
.
State
.
add
(s :
State
)
(fvarId :
FVarId
)
:
State
Equations
s
.add
fvarId
=
{
visitedExpr
:=
s
.visitedExpr
,
fvarSet
:=
s
.fvarSet
.insert
fvarId
,
fvarIds
:=
s
.fvarIds
.push
fvarId
}
Instances For
source
@[reducible, inline]
abbrev
Lean
.
CollectFVars
.
Visitor
:
Type
Equations
Lean.CollectFVars.Visitor
=
(
Lean.CollectFVars.State
→
Lean.CollectFVars.State
)
Instances For
source
partial def
Lean
.
CollectFVars
.
visit
(e :
Expr
)
:
Visitor
source
partial def
Lean
.
CollectFVars
.
main
:
Expr
→
Visitor
source
def
Lean
.
collectFVars
(s :
CollectFVars.State
)
(e :
Expr
)
:
CollectFVars.State
Equations
Lean.collectFVars
s
e
=
Lean.CollectFVars.main
e
s
Instances For