tgbascc.cc 2.58 KB
Newer Older
1
// -*- coding: utf-8 -*-
2
// Copyright (C) 2009, 2012, 2013, 2014 Laboratoire de recherche et
3
// développement de l'Epita.
4
5
6
7
8
//
// This file is part of Spot, a model checking library.
//
// Spot is free software; you can redistribute it and/or modify it
// 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
11
12
13
14
15
16
17
// (at your option) any later version.
//
// Spot is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
// License for more details.
//
// 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
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

#include <sstream>
#include "tgbascc.hh"

namespace spot
{

  tgba_scc::tgba_scc(const tgba* aut, bool show)
    : aut_(aut), scc_map_(aut), show_(show)
  {
    scc_map_.build_map();
  }

  tgba_scc::~tgba_scc()
  {
  }

  unsigned
  tgba_scc::scc_of_state(const spot::state* st) const
  {
    return scc_map_.scc_of_state(st);
  }

  state*
  tgba_scc::get_init_state() const
  {
    return aut_->get_init_state();
  }

  tgba_succ_iterator*
  tgba_scc::succ_iter(const state* local_state,
50
51
		      const state* global_state,
		      const tgba* global_automaton) const
52
  {
53
54
55
56
57
    if (iter_cache_)
      {
	aut_->release_iter(iter_cache_);
	iter_cache_ = nullptr;
      }
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
    return aut_->succ_iter(local_state, global_state, global_automaton);
  }

  bdd_dict*
  tgba_scc::get_dict() const
  {
    return aut_->get_dict();
  }

  std::string
  tgba_scc::format_state(const state* state) const
  {
    if (!show_)
      return aut_->format_state(state);

    std::ostringstream str;
    str << aut_->format_state(state);
    str << "\\nSCC #" << scc_of_state(state);
    return str.str();
  }

  std::string
  tgba_scc::transition_annotation
    (const tgba_succ_iterator* t) const
  {
    return aut_->transition_annotation(t);
  }

  state*
87
  tgba_scc::project_state(const state* s, const tgba* t) const
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
  {
    return aut_->project_state(s, t);
  }

  bdd
  tgba_scc::all_acceptance_conditions() const
  {
    return aut_->all_acceptance_conditions();
  }

  bdd
  tgba_scc::neg_acceptance_conditions() const
  {
    return aut_->neg_acceptance_conditions();
  }

  bdd
  tgba_scc::compute_support_conditions
    (const state* state) const
  {
    return aut_->support_conditions(state);
  }

  bdd
  tgba_scc::compute_support_variables
    (const state* state) const
  {
    return aut_->support_variables(state);
  }
}