spot  1.99.3
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
simplify.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2011, 2012, 2013, 2014 Laboratoire de Recherche et
3 // Developpement de l'Epita (LRDE).
4 //
5 // This file is part of Spot, a model checking library.
6 //
7 // Spot is free software; you can redistribute it and/or modify it
8 // 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 // (at your option) any later version.
11 //
12 // Spot is distributed in the hope that it will be useful, but WITHOUT
13 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 // License for more details.
16 //
17 // 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 #pragma once
21 
22 #include "ltlast/formula.hh"
23 #include <bddx.h>
24 #include "twa/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  ltl_simplifier_options(int level) :
56  ltl_simplifier_options(false, false, false)
57  {
58  switch (level)
59  {
60  case 3:
61  containment_checks = true;
62  containment_checks_stronger = true;
63  // fall through
64  case 2:
65  synt_impl = true;
66  // fall through
67  case 1:
68  reduce_basics = true;
69  event_univ = true;
70  // fall through
71  default:
72  break;
73  }
74  }
75 
76  bool reduce_basics;
77  bool synt_impl;
78  bool event_univ;
79  bool containment_checks;
80  bool containment_checks_stronger;
81  // If true, Boolean subformulae will not be put into
82  // negative normal form.
83  bool nenoform_stop_on_boolean;
84  // If true, some rules that produce slightly larger formulae
85  // will be disabled. Those larger formulae are normally easier
86  // to translate, so we recommend to set this to false.
87  bool reduce_size_strictly;
88  // If true, Boolean subformulae will be rewritten in ISOP form.
89  bool boolean_to_isop;
90  // Try to isolate subformulae that are eventual and universal.
91  bool favor_event_univ;
92  };
93 
94  // fwd declaration to hide technical details.
95  class ltl_simplifier_cache;
96 
99  class SPOT_API ltl_simplifier
100  {
101  public:
102  ltl_simplifier(const bdd_dict_ptr& dict = make_bdd_dict());
104  bdd_dict_ptr dict = make_bdd_dict());
105  ~ltl_simplifier();
106 
109  const formula* simplify(const formula* f);
110 
119  const formula*
120  negative_normal_form(const formula* f, bool negated = false);
121 
127 
140  bool syntactic_implication(const formula* f, const formula* g);
147  bool syntactic_implication_neg(const formula* f, const formula* g,
148  bool right);
149 
154  bool are_equivalent(const formula* f, const formula* g);
155 
156 
162  bool implication(const formula* f, const formula* g);
163 
168  bdd as_bdd(const formula* f);
169 
179  void clear_as_bdd_cache();
180 
182  bdd_dict_ptr get_dict() const;
183 
185  const formula* star_normal_form(const formula* f);
186 
192  const formula* boolean_to_isop(const formula* f);
193 
195  void print_stats(std::ostream& os) const;
196 
197  private:
198  ltl_simplifier_cache* cache_;
199  // Copy disallowed.
200  ltl_simplifier(const ltl_simplifier&) SPOT_DELETED;
201  void operator=(const ltl_simplifier&) SPOT_DELETED;
202  };
203  }
204 }
Definition: public.hh:31
SPOT_API const formula * negative_normal_form(const formula *f, bool negated=false)
Build the negative normal form of f.
LTL formula interface.
Rewrite or simplify f in various ways.
Definition: simplify.hh:99
Definition: simplify.hh:31
An LTL formula.
Definition: formula.hh:71

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Wed Aug 26 2015 08:42:37 for spot by doxygen 1.8.8