Learn R Programming

xegaDerivationTrees (version 1.0.0.6)

rndsub: Transforms a non-terminal symbol into a random 1-level derivation tree.

Description

rndsub() expands a non-terminal by a random derivation and returns a 1-level derivation tree.

Usage

rndsub(sym, PT)

Value

Derivation tree with 1-level.

Arguments

sym

Non-terminal symbol.

PT

Production table.

See Also

Other Generate Derivation Tree: generateCDT(), generateDerivationTree(), randomDerivationTree(), rndsubk(), substituteSymbol()

Examples

Run this code
g<-compileBNF(booleanGrammar())
rndsub(g$Start, g$PT)

Run the code above in your browser using DataLab