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

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