Add a class to represent Transition-based Alternating Automata (TAA).
* misc/Makefile.am, misc/bbop.cc, misc/bddop.hh: Factorize some code on BDDs to compute all_acceptance_conditions from neg_acceptance_condition. * src/tgba/Makefile.am, src/tgbatest/Makefile.am: Adjust. * src/tgba/taa.cc, src/tgba/taa.hh: The TAA class. * src/tgba/tgbaexplicit.hh: Use the factorized code in bddop.hh. * src/tgbatest/taa.cc, src/tgbatest/taa.test: Some test cases.
This commit is contained in:
parent
98215ed9a4
commit
20c1f01e48
11 changed files with 780 additions and 19 deletions
51
src/misc/bddop.cc
Normal file
51
src/misc/bddop.cc
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
// Copyright (C) 2009 Laboratoire d'Informatique de Paris
|
||||
// 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||
// Université Pierre et Marie Curie.
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
//
|
||||
// Spot is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Spot is distributed in the hope that it will be useful, but WITHOUT
|
||||
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Spot; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
// 02111-1307, USA.
|
||||
|
||||
#include <cassert>
|
||||
#include "bddop.hh"
|
||||
|
||||
namespace spot
|
||||
{
|
||||
bdd
|
||||
compute_all_acceptance_conditions(bdd neg_acceptance_conditions)
|
||||
{
|
||||
bdd all = bddfalse;
|
||||
|
||||
// Build all_acceptance_conditions_ from neg_acceptance_conditions_
|
||||
// I.e., transform !A & !B & !C into
|
||||
// A & !B & !C
|
||||
// + !A & B & !C
|
||||
// + !A & !B & C
|
||||
bdd cur = neg_acceptance_conditions;
|
||||
while (cur != bddtrue)
|
||||
{
|
||||
assert(cur != bddfalse);
|
||||
|
||||
bdd v = bdd_ithvar(bdd_var(cur));
|
||||
all |= v & bdd_exist(neg_acceptance_conditions, v);
|
||||
|
||||
assert(bdd_high(cur) != bddtrue);
|
||||
cur = bdd_low(cur);
|
||||
}
|
||||
|
||||
return all;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue