spot 2.12.2
emptinessta.hh
1// -*- coding: utf-8 -*-
2// Copyright (C) by the Spot authors, see the AUTHORS file for details.
3//
4// This file is part of Spot, a model checking library.
5//
6// Spot is free software; you can redistribute it and/or modify it
7// under the terms of the GNU General Public License as published by
8// the Free Software Foundation; either version 3 of the License, or
9// (at your option) any later version.
10//
11// Spot is distributed in the hope that it will be useful, but WITHOUT
12// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14// License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19#pragma once
20
21#include <spot/ta/taproduct.hh>
22#include <spot/misc/optionmap.hh>
23#include <spot/twaalgos/emptiness_stats.hh>
24#include <stack>
25#include <queue>
26
27namespace spot
28{
29
30 namespace
31 {
32 typedef std::pair<const spot::state*,
33 ta_succ_iterator_product*> pair_state_iter;
34 }
35
38
66
71 class SPOT_API ta_check : public ec_statistics
72 {
73 typedef state_map<int> hash_type;
74 public:
75 ta_check(const const_ta_product_ptr& a, option_map o = option_map());
76 virtual
77 ~ta_check();
78
96 bool
97 check(bool disable_second_pass = false,
98 bool disable_heuristic_for_livelock_detection = false);
99
104 bool
105 livelock_detection(const const_ta_product_ptr& t);
106
108 std::ostream&
109 print_stats(std::ostream& os) const;
110
111 protected:
112 void
113 clear(hash_type& h, std::stack<pair_state_iter> todo, std::queue<
114 const spot::state*> init_set);
115
116 void
117 clear(hash_type& h, std::stack<pair_state_iter> todo,
118 spot::ta_succ_iterator* init_states_it);
119
122 bool
123 heuristic_livelock_detection(const state * stuttering_succ,
124 hash_type& h, int h_livelock_root, std::set<const state*,
125 state_ptr_less_than> liveset_curr);
126
127 const_ta_product_ptr a_;
129
130 // Force the second pass
131 bool is_full_2_pass_;
132
133 // scc: a stack of strongly connected components (SCC)
134 scc_stack_ta scc;
135
136 // sscc: a stack of strongly stuttering-connected components (SSCC)
137 scc_stack_ta sscc;
138
139 };
140
142
143}
Emptiness-check statistics.
Definition: emptiness_stats.hh:57
Manage a map of options.
Definition: optionmap.hh:34
Definition: ta.hh:208
Abstract class for states.
Definition: twa.hh:47
Check whether the language of a product (spot::ta_product) between a Kripke structure and a TA is emp...
Definition: emptinessta.hh:72
bool livelock_detection(const const_ta_product_ptr &t)
Check whether the product automaton contains a livelock-accepting run Return false if the product aut...
bool heuristic_livelock_detection(const state *stuttering_succ, hash_type &h, int h_livelock_root, std::set< const state *, state_ptr_less_than > liveset_curr)
std::ostream & print_stats(std::ostream &os) const
Print statistics, if any.
const_ta_product_ptr a_
The automaton.
Definition: emptinessta.hh:127
bool check(bool disable_second_pass=false, bool disable_heuristic_for_livelock_detection=false)
Check whether the TA product automaton contains an accepting run: it detects the two kinds of accepti...
option_map o_
The options.
Definition: emptinessta.hh:128
Iterate over the successors of a state.
Definition: ta.hh:197
Definition: automata.hh:26
std::unordered_map< const state *, val, state_ptr_hash, state_ptr_equal > state_map
Unordered map of abstract states.
Definition: twa.hh:193
Strict Weak Ordering for state*.
Definition: twa.hh:124

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Fri Feb 27 2015 10:00:07 for spot by doxygen 1.9.4