spot 2.3.1

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

- File List

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
stats.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2008, 2011, 2012, 2013, 2014, 2015, 2016 Laboratoire de
3 // Recherche et 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:
62 printable_formula&
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::unique_ptr<scc_info>(new 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_;
113 printable_value<unsigned> states_;
114 printable_value<unsigned> edges_;
115 printable_value<unsigned> trans_;
116 printable_value<unsigned> acc_;
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_;
122 printable_value<std::string> gen_acc_;
123 };
124
126 }
spot
Definition: graph.hh:33
spot::scc_info
Compute an SCC map and gather assorted information.
Definition: sccinfo.hh:39
spot::sub_stats_reachable
twa_sub_statistics sub_stats_reachable(const const_twa_ptr &g)
Compute sub statistics for an automaton.
spot::printable_value
Definition: formater.hh:45
spot::formula
Main class for temporal logic formula.
Definition: formula.hh:669
spot::printable_scc_info
Definition: stats.hh:73
spot::stat_printer
prints various statistics about a TGBA
Definition: stats.hh:96
spot::printable
Definition: formater.hh:32
spot::stats_reachable
twa_statistics stats_reachable(const const_twa_ptr &g)
Compute statistics for an automaton.
spot::twa_statistics
Definition: stats.hh:36
spot::printable_formula
Definition: stats.hh:59
spot::formater
Definition: formater.hh:123
spot::twa_sub_statistics
Definition: stats.hh:45

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