spot 2.3.4

- Main Page
- Related Pages
- Modules
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
spot::random_ltl Class Reference
Temporal Logic » Input and Output of Formulas

Generate random LTL formulae. More...

`#include <spot/tl/randomltl.hh>`

Inheritance diagram for spot::random_ltl:
Collaboration diagram for spot::random_ltl:

## Public Member Functions
| random_ltl (const atomic_prop_set *ap)
const atomic_prop_set * | ap () const
| Return the set of atomic proposition used to build formulae. More...
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 | setup_proba_ ()
| random_ltl (int size, const atomic_prop_set *ap)
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_

## Detailed Description

Generate random LTL formulae.

This class recursively constructs LTL 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 LTL operators supported by Spot.

By default 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. This can be tuned using parse_options().

## Constructor & Destructor Documentation

spot::random_ltl::random_ltl | ( | const atomic_prop_set * | ap | ) |

Create a random LTL generator using atomic propositions from ap.

The default priorities are defined as follows:

    ap      n
    false   1
    true    1
    not     1
    F       1
    G       1
    X       1
    equiv   1
    implies 1
    xor     1
    R       1
    U       1
    W       1
    M       1
    and     1
    or      1

Where `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

const atomic_prop_set* spot::random_formula::ap | ( |  | ) | const
| inline inherited

Return the set of atomic proposition used to build formulae.

std::ostream& spot::random_formula::dump_priorities | ( | std::ostream & | os | ) | const
| inherited

Print the priorities of each operator, constants, and atomic propositions.

formula spot::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::multop.)

const char* spot::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.

The documentation for this class was generated from the following file:

- spot/tl/randomltl.hh

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.