tgba: move boolean properties from tgba_digraph to tgba
* src/tgba/tgbagraph.hh: Remove the set_bprop/get_bprop interface. * src/tgba/tgba.cc, src/tgba/tgba.hh: Add a new interface for setting/querying/copying the following properties: single_acc_set, state_based_acc, inherently_weak, deterministic. * src/dstarparse/dra2ba.cc, src/dstarparse/nra2nba.cc, src/neverparse/neverclaimparse.yy, src/saba/sabacomplementtgba.cc, src/tgba/tgbagraph.cc, src/tgbaalgos/degen.cc, src/tgbaalgos/dotty.cc, src/tgbaalgos/isdet.cc, src/tgbaalgos/lbtt.cc, src/tgbaalgos/minimize.cc, src/tgbaalgos/neverclaim.cc, src/tgbaalgos/postproc.cc, src/tgbaalgos/sccfilter.cc, src/tgbaalgos/simulation.cc, src/tgbatest/degenlskip.test, src/tgbatest/ltl2tgba.cc: Adjust to the new interface, or use it to bypass some useless work.
This commit is contained in:
parent
e3b5119f25
commit
b43f75e917
19 changed files with 160 additions and 87 deletions
|
|
@ -251,6 +251,89 @@ namespace spot
|
|||
private:
|
||||
mutable bdd last_support_conditions_output_;
|
||||
mutable int num_acc_;
|
||||
|
||||
protected:
|
||||
|
||||
// Boolean properties. Beware: true means that the property
|
||||
// holds, but false means the property is unknown.
|
||||
struct bprop
|
||||
{
|
||||
bool single_acc_set:1; // A single acceptance set.
|
||||
bool state_based_acc:1; // State-based acceptance.
|
||||
bool inherently_weak:1; // Weak automaton.
|
||||
bool deterministic:1; // Deterministic automaton.
|
||||
};
|
||||
union
|
||||
{
|
||||
unsigned props;
|
||||
bprop is;
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
bool has_single_acc_set() const
|
||||
{
|
||||
return is.single_acc_set;
|
||||
}
|
||||
|
||||
void prop_single_acc_set(bool val = true)
|
||||
{
|
||||
is.single_acc_set = val;
|
||||
}
|
||||
|
||||
bool has_state_based_acc() const
|
||||
{
|
||||
return is.state_based_acc;
|
||||
}
|
||||
|
||||
void prop_state_based_acc(bool val = true)
|
||||
{
|
||||
is.state_based_acc = val;
|
||||
}
|
||||
|
||||
bool is_sba() const
|
||||
{
|
||||
return has_state_based_acc() && has_single_acc_set();
|
||||
}
|
||||
|
||||
bool is_inherently_weak() const
|
||||
{
|
||||
return is.inherently_weak;
|
||||
}
|
||||
|
||||
void prop_inherently_weak(bool val = true)
|
||||
{
|
||||
is.inherently_weak = val;
|
||||
}
|
||||
|
||||
bool is_deterministic() const
|
||||
{
|
||||
return is.deterministic;
|
||||
}
|
||||
|
||||
void prop_deterministic(bool val = true)
|
||||
{
|
||||
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)
|
||||
{
|
||||
if (state_based)
|
||||
prop_state_based_acc(other->has_state_based_acc());
|
||||
if (single_acc)
|
||||
prop_single_acc_set(other->has_single_acc_set());
|
||||
if (inherently_weak)
|
||||
prop_inherently_weak(other->is_inherently_weak());
|
||||
if (deterministic)
|
||||
prop_deterministic(other->is_deterministic());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/// \addtogroup tgba_representation TGBA representations
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue