tgba_digraph: force selection of properties kept on copy

* src/tgba/tgba.hh: Declare a prop_set to specify the types.
* src/tgba/tgbagraph.hh: Use prop_set for all copy constructors.
* iface/ltsmin/ltsmin.cc, src/bin/autfilt.cc, src/bin/randaut.cc,
src/tgbaalgos/are_isomorphic.cc, src/tgbaalgos/closure.cc,
src/tgbaalgos/complete.cc, src/tgbaalgos/degen.cc,
src/tgbaalgos/dotty.cc, src/tgbaalgos/dtgbacomp.cc,
src/tgbaalgos/dupexp.cc, src/tgbaalgos/dupexp.hh,
src/tgbaalgos/sccfilter.cc, src/tgbaalgos/simulation.cc,
src/tgbaalgos/stutterize.cc, src/tgbatest/checkpsl.cc,
src/tgbatest/emptchk.cc, src/tgbatest/ltl2tgba.cc,
wrap/python/spot.i,src/graphtest/tgbagraph.test: Adjust all uses.
This commit is contained in:
Alexandre Duret-Lutz 2014-12-23 19:35:08 +01:00
parent 77cb836e47
commit 87c2b291ed
21 changed files with 309 additions and 162 deletions

View file

@ -29,6 +29,7 @@
#include <memory>
#include <unordered_map>
#include <functional>
#include <array>
#include "misc/casts.hh"
#include "misc/hash.hh"
@ -734,24 +735,45 @@ namespace spot
is.deterministic = val;
}
// This is no default value here on purpose. This way any time we
// add a new property we cannot to update every call to prop_copy().
void prop_copy(const const_tgba_ptr& other,
bool state_based,
bool single_acc,
bool inherently_weak,
bool deterministic)
struct prop_set
{
if (state_based)
bool state_based;
bool single_acc;
bool inherently_weak;
bool deterministic;
static prop_set all()
{
return { true, true, true, true };
}
};
// There is no default value here on purpose. This way any time we
// add a new property we have to update every call to prop_copy().
void prop_copy(const const_tgba_ptr& other, prop_set p)
{
if (p.state_based)
prop_state_based_acc(other->has_state_based_acc());
if (single_acc)
if (p.single_acc)
prop_single_acc_set(other->has_single_acc_set());
if (inherently_weak)
if (p.inherently_weak)
prop_inherently_weak(other->is_inherently_weak());
if (deterministic)
if (p.deterministic)
prop_deterministic(other->is_deterministic());
}
void prop_keep(prop_set p)
{
if (!p.state_based)
prop_state_based_acc(false);
if (!p.single_acc)
prop_single_acc_set(false);
if (!p.inherently_weak)
prop_inherently_weak(false);
if (!p.deterministic)
prop_deterministic(false);
}
};
/// \addtogroup tgba_representation TGBA representations