reduce.hh 4.06 KB
Newer Older
1
// Copyright (C) 2004, 2006, 2010  Laboratoire d'Informatique de Paris 6 (LIP6),
martinez's avatar
martinez committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
//
// 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.

22
23
#ifndef SPOT_LTLVISIT_REDUCE_HH
# define SPOT_LTLVISIT_REDUCE_HH
martinez's avatar
martinez committed
24
25

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

namespace spot
{
  namespace ltl
  {
32

33
34
35
    /// \addtogroup ltl_rewriting
    /// @{

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

55
56
    class syntactic_implication_cache;

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
64
    formula* reduce(const formula* f, int opt = Reduce_All,
		    syntactic_implication_cache* c = 0);
65
    /// @}
66

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

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

127
#endif //  SPOT_LTLVISIT_REDUCE_HH