spot
0.9
|
00001 // Copyright (C) 2011, 2012 Laboratoire de Recherche et Developpement 00002 // de l'Epita (LRDE). 00003 // 00004 // This file is part of Spot, a model checking library. 00005 // 00006 // Spot is free software; you can redistribute it and/or modify it 00007 // under the terms of the GNU General Public License as published by 00008 // the Free Software Foundation; either version 2 of the License, or 00009 // (at your option) any later version. 00010 // 00011 // Spot is distributed in the hope that it will be useful, but WITHOUT 00012 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00013 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 00014 // License for more details. 00015 // 00016 // You should have received a copy of the GNU General Public License 00017 // along with Spot; see the file COPYING. If not, write to the Free 00018 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00019 // 02111-1307, USA. 00020 00021 #ifndef SPOT_LTLVISIT_SIMPLIFY_HH 00022 # define SPOT_LTLVISIT_SIMPLIFY_HH 00023 00024 #include "ltlast/formula.hh" 00025 #include "bdd.h" 00026 #include "tgba/bdddict.hh" 00027 00028 namespace spot 00029 { 00030 namespace ltl 00031 { 00032 class ltl_simplifier_options 00033 { 00034 public: 00035 ltl_simplifier_options(bool basics = true, 00036 bool synt_impl = true, 00037 bool event_univ = true, 00038 bool containment_checks = false, 00039 bool containment_checks_stronger = false, 00040 bool nenoform_stop_on_boolean = false, 00041 bool reduce_size_strictly = false) 00042 : reduce_basics(basics), 00043 synt_impl(synt_impl), 00044 event_univ(event_univ), 00045 containment_checks(containment_checks), 00046 containment_checks_stronger(containment_checks_stronger), 00047 nenoform_stop_on_boolean(nenoform_stop_on_boolean), 00048 reduce_size_strictly(reduce_size_strictly) 00049 { 00050 } 00051 00052 bool reduce_basics; 00053 bool synt_impl; 00054 bool event_univ; 00055 bool containment_checks; 00056 bool containment_checks_stronger; 00057 // If true, Boolean subformulae will not be put into 00058 // negative normal form. 00059 bool nenoform_stop_on_boolean; 00060 // If true, some rules that produce slightly larger formulae 00061 // will be disabled. Those larger formulae are normally easier 00062 // to translate, so we recommend to set this to false. 00063 bool reduce_size_strictly; 00064 }; 00065 00066 // fwd declaration to hide technical details. 00067 class ltl_simplifier_cache; 00068 00071 class ltl_simplifier 00072 { 00073 public: 00074 ltl_simplifier(bdd_dict* dict = 0); 00075 ltl_simplifier(ltl_simplifier_options& opt, bdd_dict* dict = 0); 00076 ~ltl_simplifier(); 00077 00080 const formula* simplify(const formula* f); 00081 00090 const formula* 00091 negative_normal_form(const formula* f, bool negated = false); 00092 00112 bool syntactic_implication(const formula* f, const formula* g); 00118 bool syntactic_implication_neg(const formula* f, const formula* g, 00119 bool right); 00120 00125 bool are_equivalent(const formula* f, const formula* g); 00126 00131 bdd as_bdd(const formula* f); 00132 00134 bdd_dict* get_dict() const; 00135 00137 const formula* star_normal_form(const formula* f); 00138 00139 private: 00140 ltl_simplifier_cache* cache_; 00141 // Copy disallowed. 00142 ltl_simplifier(const ltl_simplifier&); 00143 bool owndict; 00144 }; 00145 } 00146 00147 } 00148 00149 #endif // SPOT_LTLVISIT_SIMPLIFY_HH