spot  0.8.1
Classes | Public Member Functions | Protected Member Functions | Private Attributes
spot::ltl::random_ltl Class Reference

Generate random LTL formulae.This class recursively construct LTL formulae of a given size. The formulae will use the use atomic propositions from the set of proposition passed to the constructor, in addition to the constant and all LTL operators supported by Spot. More...

#include <ltlvisit/randomltl.hh>

Collaboration diagram for spot::ltl::random_ltl:
Collaboration graph
[legend]

List of all members.

Classes

struct  op_proba

Public Member Functions

 random_ltl (const atomic_prop_set *ap)
 Create a random LTL generator using atomic propositions from ap.
 ~random_ltl ()
formulagenerate (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 LTL formulae.
const atomic_prop_setap () const
 Return the set of atomic proposition used to build formulae.

Protected Member Functions

void update_sums ()

Private Attributes

op_probaproba_
double total_1_
op_probaproba_2_
double total_2_
double total_2_and_more_
const atomic_prop_setap_

Detailed Description

Generate random LTL formulae.

This class recursively construct LTL formulae of a given size. The formulae will use the use atomic propositions from the set of proposition 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

Create a random LTL generator using atomic propositions from ap.


Member Function Documentation

const atomic_prop_set* spot::ltl::random_ltl::ap ( ) const [inline]

Return the set of atomic proposition used to build formulae.

References ap_.

std::ostream& spot::ltl::random_ltl::dump_priorities ( std::ostream &  os) const

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

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.)

Furthermore, for the purpose of this generator, a | b | c has length 5, while it has length 4 for spot::ltl::length().

const char* spot::ltl::random_ltl::parse_options ( char *  options)

Update the priorities used to generate LTL formulae.

The initial priorities are 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. This can be

These priorities can be altered using this function. 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_ltl::update_sums ( ) [protected]

Member Data Documentation

Referenced by ap().


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

Please comment this page and report errors about it on the RefDocComments page.
Generated on Sun Dec 18 2011 12:57:16 for spot by doxygen 1.7.6.1