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