powered by
treeLeaves() returns the number of terminal symbols in a complete derivation tree.
treeLeaves()
treeLeaves(tree, ST)
Integer. Number of terminal symbols in a complete derivation tree.
Derivation tree.
Symbol table.
Other Measures of Tree Attributes: treeListDepth(), treeNodes(), treeProbability(), treeSize()
treeListDepth()
treeNodes()
treeProbability()
treeSize()
g<-compileBNF(booleanGrammar()) a<-randomDerivationTree(g$Start, g) treeLeaves(a, g$ST) ((treeLeaves(a, g$ST)+treeNodes(a, g$ST)) == treeSize(a))
Run the code above in your browser using DataLab