Generate random Boolean formulae.This class recursively constructs Boolean formulae of a given size. The formulae will use the use atomic propositions from the set of propositions passed to the constructor, in addition to the constant and all Boolean operators supported by Spot.
More...
#include <ltlvisit/randomltl.hh>
Public Member Functions |
| random_boolean (const atomic_prop_set *ap) |
const atomic_prop_set * | ap () const |
| Return the set of atomic proposition used to build formulae.
|
const formula * | generate (int n) const |
| Generate a formula of size n.
|
std::ostream & | dump_priorities (std::ostream &os) const |
| Print the priorities of each operator, constants, and atomic propositions.
|
const char * | parse_options (char *options) |
| Update the priorities used to generate the formulae.
|
Detailed Description
Generate random Boolean formulae.
This class recursively constructs Boolean formulae of a given size. The formulae will use the use atomic propositions from the set of propositions passed to the constructor, in addition to the constant and all Boolean operators supported by Spot.
By default each operator has equal chance to be selected.
Constructor & Destructor Documentation
Create a random Boolean formula generator using atomic
propositions from \a ap.
The default priorities are defined as follows:
@verbatim
/// ap n /// false 1 /// true 1 /// not 1 /// equiv 1 /// implies 1 /// xor 1 /// and 1 /// or 1 ///
Where \c n is the number of atomic propositions in the
set passed to the constructor.
This means that each operator has equal chance to be
selected. Also, each atomic proposition has as much chance
as each constant (i.e., true and false) to be picked.
These priorities can be changed use the parse_options method.
Member Function Documentation
std::ostream& spot::ltl::random_formula::dump_priorities |
( |
std::ostream & |
os | ) |
const |
|
inherited |
Print the priorities of each operator, constants, and atomic propositions.
const formula* spot::ltl::random_formula::generate |
( |
int |
n | ) |
const |
|
inherited |
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 | ) |
|
|
inherited |
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.
void spot::ltl::random_formula::update_sums |
( |
| ) |
|
|
protectedinherited |
Member Data Documentation
op_proba* spot::ltl::random_formula::proba_ |
|
protectedinherited |
op_proba* spot::ltl::random_formula::proba_2_ |
|
protectedinherited |
op_proba* spot::ltl::random_formula::proba_2_or_more_ |
|
protectedinherited |
unsigned spot::ltl::random_formula::proba_size_ |
|
protectedinherited |
double spot::ltl::random_formula::total_1_ |
|
protectedinherited |
double spot::ltl::random_formula::total_2_ |
|
protectedinherited |
double spot::ltl::random_formula::total_2_and_more_ |
|
protectedinherited |
The documentation for this class was generated from the following file: