spot  2.4.1
stats.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2008, 2011-2017 Laboratoire de Recherche et
3 // Développement de l'Epita (LRDE).
4 // Copyright (C) 2004 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 #pragma once
24 
25 #include <spot/twa/twa.hh>
26 #include <spot/twaalgos/sccinfo.hh>
27 #include <iosfwd>
28 #include <spot/misc/formater.hh>
29 
30 namespace spot
31 {
32 
35 
36  struct SPOT_API twa_statistics
37  {
38  unsigned edges;
39  unsigned states;
40 
41  twa_statistics() { edges = 0; states = 0; }
42  std::ostream& dump(std::ostream& out) const;
43  };
44 
45  struct SPOT_API twa_sub_statistics: public twa_statistics
46  {
47  unsigned transitions;
48 
49  twa_sub_statistics() { transitions = 0; }
50  std::ostream& dump(std::ostream& out) const;
51  };
52 
54  SPOT_API twa_statistics stats_reachable(const const_twa_ptr& g);
56  SPOT_API twa_sub_statistics sub_stats_reachable(const const_twa_ptr& g);
57 
58 
59  class SPOT_API printable_formula: public printable_value<formula>
60  {
61  public:
63  operator=(formula new_val)
64  {
65  val_ = new_val;
66  return *this;
67  }
68 
69  virtual void
70  print(std::ostream& os, const char*) const override;
71  };
72 
73  class SPOT_API printable_scc_info final:
74  public spot::printable
75  {
76  std::unique_ptr<scc_info> val_;
77  public:
78  void automaton(const const_twa_graph_ptr& aut)
79  {
80  val_ = std::make_unique<scc_info>(aut);
81  }
82 
83  void reset()
84  {
85  val_ = nullptr;
86  }
87 
88  void print(std::ostream& os, const char* pos) const override;
89  };
90 
96  class SPOT_API stat_printer: protected formater
97  {
98  public:
99  stat_printer(std::ostream& os, const char* format);
100 
105  std::ostream&
106  print(const const_twa_graph_ptr& aut, formula f = nullptr,
107  double run_time = -1.);
108 
109  private:
110  const char* format_;
111 
112  printable_formula form_;
117  printable_scc_info scc_;
118  printable_value<unsigned> nondetstates_;
119  printable_value<unsigned> deterministic_;
120  printable_value<unsigned> complete_;
121  printable_value<double> run_time_;
123  };
124 
126 }
Definition: automata.hh:26
twa_sub_statistics sub_stats_reachable(const const_twa_ptr &g)
Compute sub statistics for an automaton.
Definition: formater.hh:45
Main class for temporal logic formula.
Definition: formula.hh:673
Definition: stats.hh:73
prints various statistics about a TGBA
Definition: stats.hh:96
Definition: formater.hh:32
twa_statistics stats_reachable(const const_twa_ptr &g)
Compute statistics for an automaton.
Definition: stats.hh:36
Definition: stats.hh:59
Definition: formater.hh:123
Definition: stats.hh:45

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Thu Oct 5 2017 20:23:11 for spot by doxygen 1.8.13