powered by
chooseNode() returns a random attributed node from an attributed node list.
chooseNode()
chooseNode(ANL)
An attributed node.
Attributed node list.
An attributed node has the following elements:
node
ID
NonTerminal
Pos
Depth
Rdepth
subtreedepth
Index
These elements can be used e.g.
for inserting and extracting subtrees (Pos or node$Index),
node$Index
for checking the feasibility of subtree substitution (ID),
for checking depth bounds (Depth, RDepth, and subtreedepth), ...
RDepth
Other Random Choice: chooseRule()
chooseRule()
g<-compileBNF(booleanGrammar()) a<-randomDerivationTree(g$Start, g) b<-treeANL(a, g$ST) c<-chooseNode(b$ANL)
Run the code above in your browser using DataLab