-
Notifications
You must be signed in to change notification settings - Fork 9
Specification files
Arbogen specification files (.spec files) are used to define trees' grammars and set parameters of the Boltzmann generator. Options must be defined before the grammar.
The list of available options is :
-
min
: the minimum weight of generated trees -
max
: the maximu weight of generated trees -
zstart
: the value where the search of the singularity begin -
eps1
: the initial parameter controlling the precision of the fix point found during the simple iteration -
eps2
: the initial parameter controlling the precision of the combinatorial system's singularity -
eps1_factor
: the refinement factor for eps1 (should be postive and less than 1) -
eps2_factor
: the refinement factor for eps2 (should be postive and less than 1) -
try
: the amount of simulations before a refinement -
max_refine
: the maximum amount of refinement (more than 8 is useless because floating precision) -
reject_ratio
: the ratio of (number of trees too light / number of trees). If this ratio is reached the program will refine the parameterseps1
andeps2
-
seed
: the starting seed of the pseudo random number generator -
randgen
: the pseudo random number generator's implementation (currentlyocaml
orrandu
)
The trees' grammars must be writen with the following grammar :
Rules ::= Rule | Rule Rules
Rule ::= RuleName '::=' Components
RuleName ::= <string>
Components ::= SEQ(RuleName) | Component | Component * Components
Component ::= RuleName | '<1>' | '<z>' | '<z^ <int> >'
The grammar is directly translated into a functional equation system in order to find its singularity and then compute its evaluation with this singularity.
A important remark is that a functional equation system does not directly correspond to a generative grammar. To bypass this problem we give a bit of semantic to the rule's declaration : a rule composed only by a sum of rule names is considered as an indirection. So, in the generated trees, this rule will never appear.
For example, if we take the following grammar of unary-binary trees, the rule UBTree
will never appear :
UBTree ::= UTree + BTree + Leaf
UTree ::= UBTree * <z>
BTree ::= UBTree * UBTree * <z>
Leaf ::= <1>