spot  1.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
simplify.hh
1 // Copyright (C) 2011, 2012, 2013 Laboratoire de Recherche et
2 // Developpement de l'Epita (LRDE).
3 //
4 // This file is part of Spot, a model checking library.
5 //
6 // Spot is free software; you can redistribute it and/or modify it
7 // under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // Spot is distributed in the hope that it will be useful, but WITHOUT
12 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 // License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 #ifndef SPOT_LTLVISIT_SIMPLIFY_HH
20 # define SPOT_LTLVISIT_SIMPLIFY_HH
21 
22 #include "ltlast/formula.hh"
23 #include "bdd.h"
24 #include "tgba/bdddict.hh"
25 #include <iosfwd>
26 
27 namespace spot
28 {
29  namespace ltl
30  {
32  {
33  public:
34  ltl_simplifier_options(bool basics = true,
35  bool synt_impl = true,
36  bool event_univ = true,
37  bool containment_checks = false,
38  bool containment_checks_stronger = false,
39  bool nenoform_stop_on_boolean = false,
40  bool reduce_size_strictly = false,
41  bool boolean_to_isop = false,
42  bool favor_event_univ = false)
43  : reduce_basics(basics),
44  synt_impl(synt_impl),
45  event_univ(event_univ),
46  containment_checks(containment_checks),
47  containment_checks_stronger(containment_checks_stronger),
48  nenoform_stop_on_boolean(nenoform_stop_on_boolean),
49  reduce_size_strictly(reduce_size_strictly),
50  boolean_to_isop(boolean_to_isop),
51  favor_event_univ(favor_event_univ)
52  {
53  }
54 
55  bool reduce_basics;
56  bool synt_impl;
57  bool event_univ;
58  bool containment_checks;
59  bool containment_checks_stronger;
60  // If true, Boolean subformulae will not be put into
61  // negative normal form.
62  bool nenoform_stop_on_boolean;
63  // If true, some rules that produce slightly larger formulae
64  // will be disabled. Those larger formulae are normally easier
65  // to translate, so we recommend to set this to false.
66  bool reduce_size_strictly;
67  // If true, Boolean subformulae will be rewritten in ISOP form.
68  bool boolean_to_isop;
69  // Try to isolate subformulae that are eventual and universal.
70  bool favor_event_univ;
71  };
72 
73  // fwd declaration to hide technical details.
74  class ltl_simplifier_cache;
75 
78  class SPOT_API ltl_simplifier
79  {
80  public:
81  ltl_simplifier(bdd_dict* dict = 0);
82  ltl_simplifier(const ltl_simplifier_options& opt, bdd_dict* dict = 0);
83  ~ltl_simplifier();
84 
87  const formula* simplify(const formula* f);
88 
97  const formula*
98  negative_normal_form(const formula* f, bool negated = false);
99 
105 
118  bool syntactic_implication(const formula* f, const formula* g);
125  bool syntactic_implication_neg(const formula* f, const formula* g,
126  bool right);
127 
132  bool are_equivalent(const formula* f, const formula* g);
133 
134 
140  bool implication(const formula* f, const formula* g);
141 
146  bdd as_bdd(const formula* f);
147 
157  void clear_as_bdd_cache();
158 
160  bdd_dict* get_dict() const;
161 
163  const formula* star_normal_form(const formula* f);
164 
170  const formula* boolean_to_isop(const formula* f);
171 
173  void print_stats(std::ostream& os) const;
174 
175  private:
176  ltl_simplifier_cache* cache_;
177  // Copy disallowed.
179  bool owndict;
180  };
181  }
182 
183 }
184 
185 #endif // SPOT_LTLVISIT_SIMPLIFY_HH

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Sat Dec 6 2014 12:28:43 for spot by doxygen 1.8.4