|
spot 2.16
|
Generate random SERE. More...
#include <spot/tl/randomltl.hh>
Public Member Functions | |
| random_sere (const atomic_prop_set *ap) | |
| const atomic_prop_set * | ap () const |
| Return the set of atomic proposition used to build formulas. | |
| const atomic_prop_set * | output_ap () const |
| Return the set of atomic proposition used to build formulas. | |
| std::function< bool(formula)> | is_output_fun () const |
| Return the predicate that classifies propositions as output. | |
| const atomic_prop_set * | patterns () const |
| Return the set of patterns (sub-formulas) used to build formulas. | |
| bool | draw_literals () const |
| Check whether relabeling APs should use literals. | |
| void | draw_literals (bool lit) |
| Set whether relabeling APs should use literals. | |
| 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 (const char *options) |
| Update the priorities used to generate the formulas. | |
| bool | has_unary_ops () const |
| whether we can use unary operators | |
Public Attributes | |
| random_boolean | rb |
| The Boolean formula generator used to build Boolean sub-expressions. | |
Protected Member Functions | |
| void | update_sums () |
| Recompute running probability sums after priorities have changed. | |
Protected Attributes | |
| unsigned | proba_size_ |
| Number of entries in the operator table. | |
| op_proba * | proba_ |
| Operator probability table. | |
| double | total_1_ |
| Total weight of unary operators. | |
| op_proba * | proba_2_ |
| Pointer to binary operators in the table. | |
| double | total_2_ |
| Total weight of binary operators. | |
| op_proba * | proba_2_or_more_ |
| double | total_2_and_more_ |
| Total weight of operators needing two or more children. | |
| const atomic_prop_set * | ap_ |
| const atomic_prop_set * | output_ap_ = nullptr |
| Output atomic propositions (may be null if not used). | |
| const atomic_prop_set * | patterns_ = nullptr |
| Sub-formula patterns used as atoms (may be null). | |
| std::function< bool(formula)> | is_output_ = nullptr |
| Predicate classifying a proposition as an output (may be null). | |
| bool | draw_literals_ |
| Whether relabeling APs should use literals. | |
Generate random SERE.
This class recursively constructs SERE of a given size. The formulas will use atomic propositions from the set of propositions passed to the constructor, in addition to the constant and all SERE operators supported by Spot.
By default each operator has equal chance to be selected.
| spot::random_sere::random_sere | ( | const atomic_prop_set * | ap | ) |
Create a random SERE generator using atomic propositions from ap.
The default priorities are defined as follows:
eword 1 boolform 1 star 1 star_b 1 equal_b 1 goto_b 1 and 1 andNLM 1 or 1 concat 1 fusion 1
Where "boolfrom" designates a Boolean formula generated by random_boolean.
These priorities can be changed using the parse_options method.
In addition, you can set the properties of the Boolean formula generator used to build Boolean subformulas using the parse_options method of the rb attribute.
|
inlineinherited |
Return the set of atomic proposition used to build formulas.
|
inlineinherited |
Check whether relabeling APs should use literals.
|
inlineinherited |
Set whether relabeling APs should use literals.
|
inherited |
Print the priorities of each operator, constants, and atomic propositions.
|
inherited |
Generate a formula of size n.
It is possible to obtain formulas 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.)
|
inlineinherited |
whether we can use unary operators
|
inlineinherited |
Return the predicate that classifies propositions as output.
|
inlineinherited |
Return the set of atomic proposition used to build formulas.
|
inherited |
Update the priorities used to generate the formulas.
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 input string is not modified.
|
inlineinherited |
Return the set of patterns (sub-formulas) used to build formulas.
|
protectedinherited |
Recompute running probability sums after priorities have changed.
|
protectedinherited |
Atomic propositions used to build formulas.
|
protectedinherited |
Whether relabeling APs should use literals.
|
protectedinherited |
Predicate classifying a proposition as an output (may be null).
|
protectedinherited |
Output atomic propositions (may be null if not used).
|
protectedinherited |
Sub-formula patterns used as atoms (may be null).
|
protectedinherited |
Operator probability table.
|
protectedinherited |
Pointer to binary operators in the table.
|
protectedinherited |
Pointer to operators needing ≥2 children.
|
protectedinherited |
Number of entries in the operator table.
| random_boolean spot::random_sere::rb |
The Boolean formula generator used to build Boolean sub-expressions.
|
protectedinherited |
Total weight of unary operators.
|
protectedinherited |
Total weight of binary operators.
|
protectedinherited |
Total weight of operators needing two or more children.
1.9.8