spot  1.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
randomltl.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2010, 2011, 2012, 2013 Laboratoire de Recherche et
3 // Développement de l'Epita (LRDE).
4 // Copyright (C) 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
5 // département Systèmes Répartis Coopératifs (SRC), Université Pierre
6 // et Marie Curie.
7 //
8 // This file is part of Spot, a model checking library.
9 //
10 // Spot is free software; you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation; either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Spot is distributed in the hope that it will be useful, but WITHOUT
16 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18 // License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with this program. If not, see <http://www.gnu.org/licenses/>.
22 
23 #ifndef SPOT_LTLVISIT_RANDOMLTL_HH
24 # define SPOT_LTLVISIT_RANDOMLTL_HH
25 
26 #include "apcollect.hh"
27 #include <iosfwd>
28 
29 namespace spot
30 {
31  namespace ltl
32  {
33 
36  class SPOT_API random_formula
37  {
38  public:
39  random_formula(unsigned proba_size,
40  const atomic_prop_set* ap):
41  proba_size_(proba_size), proba_(new op_proba[proba_size_]), ap_(ap)
42  {
43  }
44 
45  virtual ~random_formula()
46  {
47  delete[] proba_;
48  }
49 
51  const atomic_prop_set*
52  ap() const
53  {
54  return ap_;
55  }
56 
63  const formula* generate(int n) const;
64 
67  std::ostream& dump_priorities(std::ostream& os) const;
68 
76  const char* parse_options(char* options);
77 
78  protected:
79  void update_sums();
80 
81  struct op_proba
82  {
83  const char* name;
84  int min_n;
85  double proba;
86  typedef const formula* (*builder)(const random_formula* rl, int n);
87  builder build;
88  void setup(const char* name, int min_n, builder build);
89  };
90  unsigned proba_size_;
91  op_proba* proba_;
92  double total_1_;
93  op_proba* proba_2_;
94  double total_2_;
95  op_proba* proba_2_or_more_;
96  double total_2_and_more_;
97  const atomic_prop_set* ap_;
98  };
99 
100 
113  class SPOT_API random_ltl: public random_formula
114  {
115  public:
120 
138  random_ltl(const atomic_prop_set* ap);
148 
149  protected:
150  void setup_proba_();
151  random_ltl(int size, const atomic_prop_set* ap);
152  };
153 
163  class SPOT_API random_boolean: public random_formula
164  {
165  public:
171 
182  random_boolean(const atomic_prop_set* ap);
192  };
193 
203  class SPOT_API random_sere: public random_formula
204  {
205  public:
210 
223  random_sere(const atomic_prop_set* ap);
233 
234  random_boolean rb;
235  };
236 
244  class SPOT_API random_psl: public random_ltl
245  {
246  public:
255 
276  random_psl(const atomic_prop_set* ap);
290 
293  };
294 
295 
296 
297  }
298 }
299 
300 
301 #endif // SPOT_LTLVIST_RANDOMLTL_HH

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Sat Dec 6 2014 12:28:43 for spot by doxygen 1.8.4