Equations
- (Isotope.STm.sym a).use = {a}
- (Isotope.STm.const a).use = ∅
- (Isotope.STm.op a es).use = ⋃ i ∈ Isotope.Args.posFinset arity, (es i).use
Instances For
def
Isotope.STm.subtrees
{Arity : Type uargs}
[instArgs : Args Arity]
{L : Lang Arity}
{A : Type ua}
:
Equations
- (Isotope.STm.sym a).subtrees = {Isotope.STm.sym a}
- (Isotope.STm.const a).subtrees = {Isotope.STm.const a}
- (Isotope.STm.op a es).subtrees = {Isotope.STm.op a es} ∪ ⋃ i ∈ Isotope.Args.posFinset arity, (es i).subtrees
Instances For
Equations
- (Isotope.STm.sym a).useL = [a]
- (Isotope.STm.const a).useL = []
- (Isotope.STm.op a es).useL = List.flatMap (fun (i : Isotope.UArgs.Ix arity) => (es i).useL) (Isotope.Args.posList arity)
Instances For
def
Isotope.STm.useF
{Arity : Type uargs}
[instArgs : Args Arity]
{L : Lang Arity}
{A : Type ua}
[DecidableEq A]
:
Equations
- (Isotope.STm.sym a).useF = {a}
- (Isotope.STm.const a).useF = ∅
- (Isotope.STm.op a es).useF = (Isotope.Args.posFinset arity).biUnion fun (i : Isotope.UArgs.Ix arity) => (es i).useF
Instances For
def
Isotope.STm.subtreesL
{Arity : Type uargs}
[instArgs : Args Arity]
{L : Lang Arity}
{A : Type ua}
:
Equations
- (Isotope.STm.sym a).subtreesL = [Isotope.STm.sym a]
- (Isotope.STm.const a).subtreesL = [Isotope.STm.const a]
- (Isotope.STm.op a es).subtreesL = Isotope.STm.op a es :: List.flatMap (fun (i : Isotope.UArgs.Ix arity) => (es i).subtreesL) (Isotope.Args.posList arity)
Instances For
def
Isotope.STm.subtreesF
{Arity : Type uargs}
[instArgs : Args Arity]
{L : Lang Arity}
{A : Type ua}
[DecidableEq (STm L A)]
:
Equations
- (Isotope.STm.sym a).subtreesF = {Isotope.STm.sym a}
- (Isotope.STm.const a).subtreesF = {Isotope.STm.const a}
- (Isotope.STm.op a es).subtreesF = {Isotope.STm.op a es} ∪ (Isotope.Args.posFinset arity).biUnion fun (i : Isotope.UArgs.Ix arity) => (es i).subtreesF
Instances For
theorem
Isotope.STm.subtreesF_op
{Arity : Type uargs}
[instArgs : Args Arity]
{L : Lang Arity}
{A : Type ua}
[DecidableEq (STm L A)]
{arity : Arity}
(o : L.Op arity)
(es : UArgs.Ix arity → STm L A)
:
def
Isotope.STm.children
{Arity : Type uargs}
[instArgs : Args Arity]
{L : Lang Arity}
{A : Type ua}
:
Equations
- (Isotope.STm.sym a).children = []
- (Isotope.STm.const a).children = []
- (Isotope.STm.op a es).children = List.map (fun (i : Isotope.UArgs.Ix arity) => es i) (Isotope.Args.posList arity)
Instances For
def
Isotope.STm.strictSubtrees
{Arity : Type uargs}
[instArgs : Args Arity]
{L : Lang Arity}
{A : Type ua}
:
Equations
- (Isotope.STm.sym a).strictSubtrees = ∅
- (Isotope.STm.const a).strictSubtrees = ∅
- (Isotope.STm.op a es).strictSubtrees = ⋃ i ∈ Isotope.Args.posFinset arity, (es i).subtrees
Instances For
@[simp]
theorem
Isotope.STm.strictSubtrees_sym
{Arity : Type uargs}
[instArgs : Args Arity]
{L : Lang Arity}
{A : Type ua}
(a : A)
:
Equations
- (Isotope.STm.sym a).depth = 0
- (Isotope.STm.const a).depth = 0
- (Isotope.STm.op a es).depth = 1 + List.foldl (fun (acc : ℕ) (i : Isotope.UArgs.Ix arity) => max acc (es i).depth) 0 (Isotope.Args.posList arity)
Instances For
Equations
- (Isotope.STm.sym a).size = 1
- (Isotope.STm.const a).size = 1
- (Isotope.STm.op a es).size = 1 + List.foldl (fun (acc : ℕ) (i : Isotope.UArgs.Ix arity) => acc + (es i).size) 0 (Isotope.Args.posList arity)