relabel.hh 1.98 KB
Newer Older
1
// -*- coding: utf-8 -*-
2
// Copyright (C) 2012, 2013 Laboratoire de Recherche et
3
4
5
6
7
8
// Développement de l'Epita (LRDE).
//
// 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

#ifndef SPOT_LTLVISIT_RELABEL_HH
# define SPOT_LTLVISIT_RELABEL_HH

23
24
#include "ltlast/formula.hh"
#include "misc/hash.hh"
25
26
27
28
29
30
31

namespace spot
{
  namespace ltl
  {
    enum relabeling_style { Abc, Pnn };

32

33
34
35
    struct relabeling_map: public std::unordered_map<const formula*,
						     const formula*,
						     ptr_hash<formula>>
36
37
38
39
40
41
42
43
    {
      ~relabeling_map()
      {
	for (iterator i = begin(); i != end(); ++i)
	  i->second->destroy();
      }
    };

44
    /// \ingroup ltl_rewriting
45
    /// \brief Relabel the atomic propositions in a formula.
46
47
48
    ///
    /// If \a m is non-null, it is filled with correspondence
    /// between the new names (keys) and the old names (values).
49
    SPOT_API
50
51
52
53
54
55
56
57
58
59
60
61
62
63
    const formula* relabel(const formula* f, relabeling_style style,
			   relabeling_map* m = 0);


    /// \ingroup ltl_rewriting
    /// \brief Relabel Boolean subexpressions in a formula using
    /// atomic propositions.
    ///
    /// If \a m is non-null, it is filled with correspondence
    /// between the new names (keys) and the old names (values).
    SPOT_API
    const formula* relabel_bse(const formula* f, relabeling_style style,
			       relabeling_map* m = 0);

64
65
66
67
68
69
  }
}



#endif // SPOT_LTLVISIT_RELABEL_HH