* src/tgba/bdddict.cc, src/tgba/bdddict.cc (register_clone_acc):
New function. * src/tgba/tgbaproduct.cc, src/tgba/tgbaproduct.hh: Use it to distinguish acceptance conditions that are identical in both operands. * src/tgbatest/explpro4.test: New file. * src/tgbatest/explpro2.test, src/tgbatest/Makefile.am: Adjust.
This commit is contained in:
parent
cb9549e4d4
commit
c412cd4cc3
7 changed files with 129 additions and 21 deletions
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
// et Marie Curie.
|
||||
//
|
||||
|
|
@ -72,10 +72,11 @@ namespace spot
|
|||
|
||||
tgba_succ_iterator_product::tgba_succ_iterator_product
|
||||
(tgba_succ_iterator* left, tgba_succ_iterator* right,
|
||||
bdd left_neg, bdd right_neg)
|
||||
bdd left_neg, bdd right_neg, bddPair* right_common_acc)
|
||||
: left_(left), right_(right),
|
||||
left_neg_(left_neg),
|
||||
right_neg_(right_neg)
|
||||
right_neg_(right_neg),
|
||||
right_common_acc_(right_common_acc)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -165,7 +166,8 @@ namespace spot
|
|||
bdd tgba_succ_iterator_product::current_acceptance_conditions() const
|
||||
{
|
||||
return ((left_->current_acceptance_conditions() & right_neg_)
|
||||
| (right_->current_acceptance_conditions() & left_neg_));
|
||||
| (bdd_replace(right_->current_acceptance_conditions(),
|
||||
right_common_acc_) & left_neg_));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
|
@ -178,13 +180,31 @@ namespace spot
|
|||
|
||||
bdd lna = left_->neg_acceptance_conditions();
|
||||
bdd rna = right_->neg_acceptance_conditions();
|
||||
left_acc_complement_ = bdd_exist(lna, bdd_support(rna));
|
||||
right_acc_complement_ = bdd_exist(rna, bdd_support(lna));
|
||||
|
||||
all_acceptance_conditions_ = ((left_->all_acceptance_conditions()
|
||||
& right_acc_complement_)
|
||||
| (right_->all_acceptance_conditions()
|
||||
& left_acc_complement_));
|
||||
right_common_acc_ = bdd_newpair();
|
||||
bdd common = bdd_exist(lna, bdd_exist(lna, rna));
|
||||
while (common != bddtrue)
|
||||
{
|
||||
assert(bdd_high(common) == bddfalse);
|
||||
int var = bdd_var(common);
|
||||
int varclone = dict_->register_clone_acc(var, this);
|
||||
bdd_setpair(right_common_acc_, var, varclone);
|
||||
common = bdd_low(common);
|
||||
}
|
||||
|
||||
bdd lac = left_->all_acceptance_conditions();
|
||||
bdd rac = right_->all_acceptance_conditions();
|
||||
|
||||
rna = bdd_replace(rna, right_common_acc_);
|
||||
rac = bdd_replace(rac, right_common_acc_);
|
||||
|
||||
left_acc_complement_ = lna;
|
||||
assert(bdd_exist(lna, rna) == lna);
|
||||
right_acc_complement_ = rna;
|
||||
assert(bdd_exist(rna, lna) == rna);
|
||||
|
||||
all_acceptance_conditions_ = ((lac & right_acc_complement_)
|
||||
| (rac & left_acc_complement_));
|
||||
neg_acceptance_conditions_ = lna & rna;
|
||||
|
||||
dict_->register_all_variables_of(&left_, this);
|
||||
|
|
@ -193,6 +213,7 @@ namespace spot
|
|||
|
||||
tgba_product::~tgba_product()
|
||||
{
|
||||
bdd_freepair(right_common_acc_);
|
||||
dict_->unregister_all_my_variables(this);
|
||||
}
|
||||
|
||||
|
|
@ -226,7 +247,8 @@ namespace spot
|
|||
global_state, global_automaton);
|
||||
return new tgba_succ_iterator_product(li, ri,
|
||||
left_acc_complement_,
|
||||
right_acc_complement_);
|
||||
right_acc_complement_,
|
||||
right_common_acc_);
|
||||
}
|
||||
|
||||
bdd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue