spot
1.2.6
|
Base class for random formula generators. More...
#include <ltlvisit/randomltl.hh>
Classes | |
struct | op_proba |
Public Member Functions | |
random_formula (unsigned proba_size, const atomic_prop_set *ap) | |
const atomic_prop_set * | ap () const |
Return the set of atomic proposition used to build formulae. More... | |
const formula * | generate (int n) const |
Generate a formula of size n. More... | |
std::ostream & | dump_priorities (std::ostream &os) const |
Print the priorities of each operator, constants, and atomic propositions. More... | |
const char * | parse_options (char *options) |
Update the priorities used to generate the formulae. More... | |
Protected Member Functions | |
void | update_sums () |
Protected Attributes | |
unsigned | proba_size_ |
op_proba * | proba_ |
double | total_1_ |
op_proba * | proba_2_ |
double | total_2_ |
op_proba * | proba_2_or_more_ |
double | total_2_and_more_ |
const atomic_prop_set * | ap_ |
Base class for random formula generators.
|
inline |
Return the set of atomic proposition used to build formulae.
std::ostream& spot::ltl::random_formula::dump_priorities | ( | std::ostream & | os) | const |
Print the priorities of each operator, constants, and atomic propositions.
const formula* spot::ltl::random_formula::generate | ( | int | n) | const |
Generate a formula of size n.
It is possible to obtain formulae that are smaller than n, because some simple simplifications are performed by the AST. (For instance the formula a | a
is automatically reduced to a
by spot::ltl::multop.)
const char* spot::ltl::random_formula::parse_options | ( | char * | options) |
Update the priorities used to generate the formulae.
options should be comma-separated list of KEY=VALUE assignments, using keys from the above list. For instance "xor=0, F=3"
will prevent xor
from being used, and will raise the relative probability of occurrences of the F
operator.