tgtaproduct.hh 2.46 KB
Newer Older
1
// -*- coding: utf-8 -*-
2
3
// Copyright (C) 2011, 2012, 2013, 2014 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
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
#ifndef SPOT_TA_TGTAPRODUCT_HH
# define SPOT_TA_TGTAPRODUCT_HH
22
23
24
25
26

#include "tgba/tgba.hh"
#include "tgba/tgbaproduct.hh"
#include "misc/fixpool.hh"
#include "kripke/kripke.hh"
27
#include "tgta.hh"
28
29
30
31
32

namespace spot
{

  /// \brief A lazy product.  (States are computed on the fly.)
33
  class SPOT_API tgta_product : public tgba_product
34
35
  {
  public:
36
    tgta_product(const kripke* left, const tgta* right);
37
38
39
40
41

    virtual state*
    get_init_state() const;

    virtual tgba_succ_iterator*
42
    succ_iter(const state* local_state) const;
43
44
45
  };

  /// \brief Iterate over the successors of a product computed on the fly.
46
  class SPOT_API tgta_succ_iterator_product : public tgba_succ_iterator
47
48
  {
  public:
49
50
    tgta_succ_iterator_product(const state_product* s, const kripke* k,
			       const tgta* tgta, fixed_size_pool* pool);
51
52

    virtual
53
    ~tgta_succ_iterator_product();
54
55

    // iteration
56
57
58
    bool first();
    bool next();
    bool done() const;
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

    // inspection
    state_product*
    current_state() const;
    bdd
    current_condition() const;

    bdd
    current_acceptance_conditions() const;

  private:
    //@{
    /// Internal routines to advance to the next successor.
    void
    step_();
74
    bool find_next_succ_();
75
76
77
78
79
80
81
82

    void
    next_kripke_dest();

    //@}

  protected:
    const state_product* source_;
83
    const tgta* tgta_;
84
85
    const kripke* kripke_;
    fixed_size_pool* pool_;
86
    tgba_succ_iterator* tgta_succ_it_;
87
88
89
90
91
    tgba_succ_iterator* kripke_succ_it_;
    state_product* current_state_;
    bdd current_condition_;
    bdd current_acceptance_conditions_;
    bdd kripke_source_condition;
92
    state* kripke_current_dest_state;
93
94
95
96
  };

}

97
#endif // SPOT_TA_TGTAPRODUCT_HH