spot
0.8.3
|
00001 // Copyright (C) 2009 Laboratoire de Recherche et Développement 00002 // de l'Epita (LRDE). 00003 // Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6), 00004 // département Systèmes Répartis Coopératifs (SRC), Université Pierre 00005 // et Marie Curie. 00006 // 00007 // This file is part of Spot, a model checking library. 00008 // 00009 // Spot is free software; you can redistribute it and/or modify it 00010 // under the terms of the GNU General Public License as published by 00011 // the Free Software Foundation; either version 2 of the License, or 00012 // (at your option) any later version. 00013 // 00014 // Spot is distributed in the hope that it will be useful, but WITHOUT 00015 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00016 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 00017 // License for more details. 00018 // 00019 // You should have received a copy of the GNU General Public License 00020 // along with Spot; see the file COPYING. If not, write to the Free 00021 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00022 // 02111-1307, USA. 00023 00024 #ifndef SPOT_MISC_MINATO_HH 00025 # define SPOT_MISC_MINATO_HH 00026 00027 # include <bdd.h> 00028 # include <stack> 00029 00030 namespace spot 00031 { 00052 class minato_isop 00053 { 00054 public: 00057 minato_isop(bdd input); 00061 minato_isop(bdd input, bdd vars); 00064 bdd next(); 00065 00066 private: 00068 struct local_vars 00069 { 00070 // If you are following the paper, f_min and f_max correspond 00071 // to the pair of BDD functions used to encode the ternary function f 00072 // (see Section 3.4). 00073 // Also note that f0, f0', and f0'' all share the same _max function. 00074 // Likewise for f1, f1', and f1''. 00075 bdd f_min, f_max; 00076 // Because we need a non-recursive version of the algorithm, 00077 // we had to split it in four steps (each step is separated 00078 // from the other by a call to ISOP in the original algorithm). 00079 enum { FirstStep, SecondStep, ThirdStep, FourthStep } step; 00080 // The list of variables to factorize. This is an addition to 00081 // the original algorithm. 00082 bdd vars; 00083 bdd v1; 00084 bdd f0_min, f0_max; 00085 bdd f1_min, f1_max; 00086 bdd g0, g1; 00087 local_vars(bdd f_min, bdd f_max, bdd vars) 00088 : f_min(f_min), f_max(f_max), step(FirstStep), vars(vars) {} 00089 }; 00090 std::stack<local_vars> todo_; 00091 std::stack<bdd> cube_; 00092 bdd ret_; 00093 }; 00094 } 00095 00096 #endif // SPOT_MISC_MINATO_HH