Lexical scope
¥
LS(w) = LS
t
(
t
(w))
¥
LS
t
(
t
(w)
) = 1
if
t
is a leaf
¥
LS
t
(
t
(w)
) = (
LS(
t
1
) + LS(
t
2
))
/(2-sin(D(
t
(w)
))
¥
otherwise
¥
n
(w) =
n
t
(
t
(w))
¥
n
t
(
t
(w)
) =
n
(w)
if
t
is a leaf
¥
n
t
(
t
(w)
) = LS(
t
1
)
n
t
(
t
1
) + LS(
t
2
)
n
t
(
t
2
)
¥
otherwise
¥
1:D(3,4),
n
(3+2)
2:
n
4
7:
n
2
6:
n
1
4:
n
3
5:D(6,7),
n
(6+7)
3:D(4,5),
n
(4+5)
Can handle duplicated definitions
t
(w) =