reduce.hh 4.05 KB
Newer Older
1
2
3
4
5
// Copyright (C) 2010, 2011 Laboratoire de Recherche et Developpement
// de l'Epita (LRDE).
// Copyright (C) 2004, 2006 Laboratoire d'Informatique de Paris 6
// (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
// Pierre et Marie Curie.
martinez's avatar
martinez committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//
// 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
// the Free Software Foundation; either version 2 of the License, or
// (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
// along with Spot; see the file COPYING.  If not, write to the Free
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.

24
25
#ifndef SPOT_LTLVISIT_REDUCE_HH
# define SPOT_LTLVISIT_REDUCE_HH
martinez's avatar
martinez committed
26
27

#include "ltlast/formula.hh"
28
#include "ltlast/visitor.hh"
martinez's avatar
martinez committed
29
30
31
32
33

namespace spot
{
  namespace ltl
  {
34

35
36
37
    /// \addtogroup ltl_rewriting
    /// @{

38
    /// Options for spot::ltl::reduce.
39
40
    enum reduce_options
      {
41
	/// No reduction.
42
	Reduce_None = 0,
43
	/// Basic reductions.
44
	Reduce_Basics = 1,
45
	/// Somenzi & Bloem syntactic implication.
46
	Reduce_Syntactic_Implications = 2,
47
	/// Etessami & Holzmann eventuality and universality reductions.
48
	Reduce_Eventuality_And_Universality = 4,
49
50
51
52
	/// Tauriainen containment checks.
	Reduce_Containment_Checks = 8,
	/// Tauriainen containment checks (stronger version).
	Reduce_Containment_Checks_Stronger = 16,
53
	/// All reductions.
54
55
	Reduce_All = -1U
      };
56

57
    /// \brief Reduce a formula \a f.
58
    ///
59
60
    /// \param f the formula to reduce
    /// \param opt a conjonction of spot::ltl::reduce_options specifying
61
    ///            which optimizations to apply.
62
    /// \return the reduced formula
63
    formula* reduce(const formula* f, int opt = Reduce_All);
64
    /// @}
65

66
    /// \brief Check whether a formula is a pure eventuality.
67
    /// \ingroup ltl_misc
68
    ///
69
    /// Pure eventuality formulae are defined in
70
71
    /// \verbatim
    /// @InProceedings{	  etessami.00.concur,
72
    /// author		= {Kousha Etessami and Gerard J. Holzmann},
73
74
75
76
77
    /// title		= {Optimizing {B\"u}chi Automata},
    /// booktitle	= {Proceedings of the 11th International Conference on
    /// 		  Concurrency Theory (Concur'2000)},
    /// pages		= {153--167},
    /// year		= {2000},
78
79
80
    /// editor		= {C. Palamidessi},
    /// volume		= {1877},
    /// series		= {Lecture Notes in Computer Science},
81
    /// publisher	= {Springer-Verlag}
82
83
    /// }
    /// \endverbatim
84
85
86
    ///
    /// A word that satisfies a pure eventuality can be prefixed by
    /// anything and still satisfies the formula.
87
88
89
90
91
    ///
    /// \deprecated Use f->is_eventual() instead.
#if __GNUC__
    bool is_eventual(const formula* f) __attribute__ ((deprecated));
#else
martinez's avatar
martinez committed
92
    bool is_eventual(const formula* f);
93
#endif
94

95
    /// \brief Check whether a formula is purely universal.
96
    /// \ingroup ltl_misc
97
98
99
100
    ///
    /// Purely universal formulae are defined in
    /// \verbatim
    /// @InProceedings{	  etessami.00.concur,
101
    /// author		= {Kousha Etessami and Gerard J. Holzmann},
102
103
104
105
106
    /// title		= {Optimizing {B\"u}chi Automata},
    /// booktitle	= {Proceedings of the 11th International Conference on
    /// 		  Concurrency Theory (Concur'2000)},
    /// pages		= {153--167},
    /// year		= {2000},
107
108
109
    /// editor		= {C. Palamidessi},
    /// volume		= {1877},
    /// series		= {Lecture Notes in Computer Science},
110
111
112
    /// publisher	= {Springer-Verlag}
    /// }
    /// \endverbatim
113
    ///
114
115
    /// Any (non-empty) suffix of a word that satisfies if purely
    /// universal formula also satisfies the formula.
116
117
118
119
120
    ///
    /// \deprecated Use f->is_universal() instead.
#if __GNUC__
    bool is_universal(const formula* f) __attribute__ ((deprecated));
#else
martinez's avatar
martinez committed
121
    bool is_universal(const formula* f);
122
#endif
martinez's avatar
martinez committed
123
124
125
  }
}

126
#endif //  SPOT_LTLVISIT_REDUCE_HH