twa: rename the is_* getters as prop_*
This fixes #116. * src/twa/twa.hh: Rename those methods. * NEWS: Document the renamings. * doc/org/hoa.org, doc/org/tut21.org, src/parseaut/parseaut.yy, src/tests/ikwiad.cc, src/twa/twagraph.hh, src/twaalgos/are_isomorphic.cc, src/twaalgos/complete.cc, src/twaalgos/degen.cc, src/twaalgos/dot.cc, src/twaalgos/dtbasat.cc, src/twaalgos/dtgbasat.cc, src/twaalgos/hoa.cc, src/twaalgos/isdet.cc, src/twaalgos/isunamb.cc, src/twaalgos/lbtt.cc, src/twaalgos/minimize.cc, src/twaalgos/postproc.cc, src/twaalgos/product.cc, src/twaalgos/randomgraph.cc, src/twaalgos/remfin.cc, src/twaalgos/sbacc.cc, src/twaalgos/simulation.cc, src/twaalgos/stutter.cc, src/twaalgos/totgba.cc: Adjust.
This commit is contained in:
parent
8ea5f73c1a
commit
cbb2e64e7c
26 changed files with 105 additions and 83 deletions
|
|
@ -113,7 +113,7 @@ namespace spot
|
|||
isomorphism_checker::isomorphism_checker(const const_twa_graph_ptr ref)
|
||||
{
|
||||
ref_ = make_twa_graph(ref, twa::prop_set::all());
|
||||
ref_deterministic_ = ref_->is_deterministic();
|
||||
ref_deterministic_ = ref_->prop_deterministic();
|
||||
if (!ref_deterministic_)
|
||||
{
|
||||
nondet_states_ = spot::count_nondet_states(ref_);
|
||||
|
|
@ -130,14 +130,14 @@ namespace spot
|
|||
|
||||
if (ref_deterministic_)
|
||||
{
|
||||
if (aut->is_deterministic() || spot::is_deterministic(aut))
|
||||
if (aut->prop_deterministic() || spot::is_deterministic(aut))
|
||||
{
|
||||
return are_isomorphic_det(ref_, aut);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (aut->is_deterministic() ||
|
||||
if (aut->prop_deterministic() ||
|
||||
nondet_states_ != spot::count_nondet_states(aut))
|
||||
{
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ namespace spot
|
|||
}
|
||||
// In case the automaton use state-based acceptance, propagate
|
||||
// the acceptance of the first edge to the one we add.
|
||||
if (!aut->has_state_based_acc())
|
||||
if (!aut->prop_state_acc())
|
||||
acc = 0U;
|
||||
aut->new_edge(i, sink, missingcond, acc);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ namespace spot
|
|||
res->copy_ap_of(a);
|
||||
res->set_buchi();
|
||||
if (want_sba)
|
||||
res->prop_state_based_acc(true);
|
||||
res->prop_state_acc(true);
|
||||
// Preserve determinism, weakness, and stutter-invariance
|
||||
res->prop_copy(a, { false, true, true, true });
|
||||
|
||||
|
|
|
|||
|
|
@ -468,7 +468,7 @@ namespace spot
|
|||
sn_ = aut->get_named_prop<std::vector<std::string>>("state-names");
|
||||
if (opt_name_)
|
||||
name_ = aut_->get_named_prop<std::string>("automaton-name");
|
||||
mark_states_ = !opt_force_acc_trans_ && aut_->has_state_based_acc();
|
||||
mark_states_ = !opt_force_acc_trans_ && aut_->prop_state_acc();
|
||||
if (opt_shape_ == ShapeAuto)
|
||||
{
|
||||
if (sn_ || aut->num_states() > 100)
|
||||
|
|
|
|||
|
|
@ -640,7 +640,7 @@ namespace spot
|
|||
a->copy_ap_of(aut);
|
||||
acc_cond::mark_t acc = a->set_buchi();
|
||||
if (state_based)
|
||||
a->prop_state_based_acc(true);
|
||||
a->prop_state_acc(true);
|
||||
a->prop_deterministic(true);
|
||||
a->new_states(satdict.cand_size);
|
||||
|
||||
|
|
|
|||
|
|
@ -1026,7 +1026,7 @@ namespace spot
|
|||
auto a = make_twa_graph(autdict);
|
||||
a->copy_ap_of(aut);
|
||||
if (state_based)
|
||||
a->prop_state_based_acc(true);
|
||||
a->prop_state_acc(true);
|
||||
a->prop_deterministic(true);
|
||||
a->set_acceptance(satdict.cand_nacc, satdict.cand_acc);
|
||||
a->new_states(satdict.cand_size);
|
||||
|
|
@ -1303,7 +1303,7 @@ namespace spot
|
|||
if (int preproc = om.get("preproc", 3))
|
||||
{
|
||||
postprocessor post;
|
||||
auto sba = (state_based && a->has_state_based_acc()) ?
|
||||
auto sba = (state_based && a->prop_state_acc()) ?
|
||||
postprocessor::SBAcc : postprocessor::Any;
|
||||
post.set_pref(postprocessor::Deterministic
|
||||
| postprocessor::Complete
|
||||
|
|
@ -1332,7 +1332,7 @@ namespace spot
|
|||
// mode. If the desired output is a Büchi automaton, or not
|
||||
// desired acceptance was specified, stop here. There is not
|
||||
// point in minimizing a minimal automaton.
|
||||
if (a->is_inherently_weak() && a->is_deterministic()
|
||||
if (a->prop_inherently_weak() && a->prop_deterministic()
|
||||
&& (target_is_buchi || !user_supplied_acc))
|
||||
return a;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,8 +153,8 @@ namespace spot
|
|||
is_colored = colored && (!has_state_acc || nodeadend);
|
||||
// If the automaton declares that it is deterministic or
|
||||
// state-based, make sure that it really is.
|
||||
assert(!aut->is_deterministic() || deterministic);
|
||||
assert(!aut->has_state_based_acc() || state_acc);
|
||||
assert(!aut->prop_deterministic() || deterministic);
|
||||
assert(!aut->prop_state_acc() || state_acc);
|
||||
}
|
||||
|
||||
void number_all_ap()
|
||||
|
|
@ -402,14 +402,14 @@ namespace spot
|
|||
prop(" complete");
|
||||
if (md.is_deterministic)
|
||||
prop(" deterministic");
|
||||
if (aut->is_unambiguous())
|
||||
if (aut->prop_unambiguous())
|
||||
prop(" unambiguous");
|
||||
assert(!(aut->is_stutter_invariant() && aut->is_stutter_sensitive()));
|
||||
if (aut->is_stutter_invariant())
|
||||
assert(!(aut->prop_stutter_invariant() && aut->prop_stutter_sensitive()));
|
||||
if (aut->prop_stutter_invariant())
|
||||
prop(" stutter-invariant");
|
||||
if (aut->is_stutter_sensitive())
|
||||
if (aut->prop_stutter_sensitive())
|
||||
prop(" stutter-sensitive");
|
||||
if (aut->is_inherently_weak())
|
||||
if (aut->prop_inherently_weak())
|
||||
prop(" inherently-weak");
|
||||
os << nl;
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ namespace spot
|
|||
bool
|
||||
is_deterministic(const const_twa_graph_ptr& aut)
|
||||
{
|
||||
if (aut->is_deterministic())
|
||||
if (aut->prop_deterministic())
|
||||
return true;
|
||||
return !count_nondet_states_aux<false>(aut);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ namespace spot
|
|||
{
|
||||
bool is_unambiguous(const const_twa_graph_ptr& aut)
|
||||
{
|
||||
if (aut->is_deterministic() || aut->is_unambiguous())
|
||||
if (aut->prop_deterministic() || aut->prop_unambiguous())
|
||||
return true;
|
||||
auto clean_a = scc_filter_states(aut);
|
||||
if (clean_a->num_edges() == 0)
|
||||
|
|
@ -41,6 +41,6 @@ namespace spot
|
|||
bool check_unambiguous(const twa_graph_ptr& aut)
|
||||
{
|
||||
aut->prop_unambiguous(is_unambiguous(aut));
|
||||
return aut->is_unambiguous();
|
||||
return aut->prop_unambiguous();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ namespace spot
|
|||
throw std::runtime_error
|
||||
("LBTT only supports generalized Büchi acceptance");
|
||||
|
||||
bool sba = g->has_state_based_acc();
|
||||
bool sba = g->prop_state_acc();
|
||||
if (opt)
|
||||
switch (char c = *opt++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ namespace spot
|
|||
auto dict = a->get_dict();
|
||||
auto res = make_twa_graph(dict);
|
||||
res->copy_ap_of(a);
|
||||
res->prop_state_based_acc(true);
|
||||
res->prop_state_acc(true);
|
||||
|
||||
// For each set, create a state in the resulting automaton.
|
||||
// For a state s, state_num[s] is the number of the state in the minimal
|
||||
|
|
@ -483,7 +483,7 @@ namespace spot
|
|||
res->prop_copy(a, { false, false, false, true });
|
||||
res->prop_deterministic(true);
|
||||
res->prop_inherently_weak(true);
|
||||
res->prop_state_based_acc(true);
|
||||
res->prop_state_acc(true);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -605,7 +605,7 @@ namespace spot
|
|||
|
||||
// If the input automaton was already weak and deterministic, the
|
||||
// output is necessary correct.
|
||||
if (aut_f->is_inherently_weak() && aut_f->is_deterministic())
|
||||
if (aut_f->prop_inherently_weak() && aut_f->prop_deterministic())
|
||||
return min_aut_f;
|
||||
|
||||
// if f is a syntactic obligation formula, the WDBA minimization
|
||||
|
|
@ -654,7 +654,7 @@ namespace spot
|
|||
if (product(min_aut_f, aut_neg_f)->is_empty())
|
||||
{
|
||||
// Complement the minimized WDBA.
|
||||
assert(min_aut_f->is_inherently_weak());
|
||||
assert(min_aut_f->prop_inherently_weak());
|
||||
auto neg_min_aut_f = remove_fin(dtwa_complement(min_aut_f));
|
||||
if (product(aut_f, neg_min_aut_f)->is_empty())
|
||||
// Finally, we are now sure that it was safe
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ namespace spot
|
|||
return a;
|
||||
// If the automaton is weak, using transition-based acceptance
|
||||
// won't help, so let's preserve it.
|
||||
if ((state_based_ || a->is_inherently_weak()) && a->has_state_based_acc())
|
||||
if ((state_based_ || a->prop_inherently_weak()) && a->prop_state_acc())
|
||||
return scc_filter_states(a, arg);
|
||||
else
|
||||
return scc_filter(a, arg);
|
||||
|
|
@ -253,7 +253,7 @@ namespace spot
|
|||
{
|
||||
bool reject_bigger = (PREF_ == Small) && (level_ == Medium);
|
||||
dba = minimize_obligation(a, f, nullptr, reject_bigger);
|
||||
if (dba && dba->is_inherently_weak() && dba->is_deterministic())
|
||||
if (dba && dba->prop_inherently_weak() && dba->prop_deterministic())
|
||||
{
|
||||
// The WDBA is a BA, so no degeneralization is required.
|
||||
// We just need to add an acceptance set if there is none.
|
||||
|
|
@ -272,7 +272,7 @@ namespace spot
|
|||
// at hard levels if we want a small output.
|
||||
if (!dba || (level_ == High && PREF_ == Small))
|
||||
{
|
||||
if (((SBACC_ && a->has_state_based_acc())
|
||||
if (((SBACC_ && a->prop_state_acc())
|
||||
|| (type_ == BA && a->is_sba()))
|
||||
&& !tba_determinisation_)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -103,14 +103,14 @@ namespace spot
|
|||
}
|
||||
}
|
||||
|
||||
res->prop_deterministic(left->is_deterministic()
|
||||
&& right->is_deterministic());
|
||||
res->prop_stutter_invariant(left->is_stutter_invariant()
|
||||
&& right->is_stutter_invariant());
|
||||
res->prop_stutter_sensitive(left->is_stutter_sensitive()
|
||||
&& right->is_stutter_sensitive());
|
||||
res->prop_state_based_acc(left->has_state_based_acc()
|
||||
&& right->has_state_based_acc());
|
||||
res->prop_deterministic(left->prop_deterministic()
|
||||
&& right->prop_deterministic());
|
||||
res->prop_stutter_invariant(left->prop_stutter_invariant()
|
||||
&& right->prop_stutter_invariant());
|
||||
res->prop_stutter_sensitive(left->prop_stutter_sensitive()
|
||||
&& right->prop_stutter_sensitive());
|
||||
res->prop_state_acc(left->prop_state_acc()
|
||||
&& right->prop_state_acc());
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ namespace spot
|
|||
if (deterministic)
|
||||
res->prop_deterministic(true);
|
||||
if (state_acc)
|
||||
res->prop_state_based_acc(true);
|
||||
res->prop_state_acc(true);
|
||||
|
||||
int props_n = ap->size();
|
||||
int* props = new int[props_n];
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ namespace spot
|
|||
// check result, however it prevent recurring into this
|
||||
// procedure, because empty() will call to_tgba() wich will
|
||||
// call remove_fin()...
|
||||
sccaut->prop_state_based_acc(false);
|
||||
sccaut->prop_state_acc(false);
|
||||
// If SCCAUT is empty, the SCC is BA-type (and none
|
||||
// of its states are final). If SCCAUT is nonempty, the SCC
|
||||
// is not BA type.
|
||||
|
|
@ -153,7 +153,7 @@ namespace spot
|
|||
acc_cond::mark_t inf_alone,
|
||||
acc_cond::mark_t fin_alone)
|
||||
{
|
||||
assert(aut->has_state_based_acc());
|
||||
assert(aut->prop_state_acc());
|
||||
|
||||
scc_info si(aut);
|
||||
// For state-based Rabin automata, we check each SCC for
|
||||
|
|
@ -227,7 +227,7 @@ namespace spot
|
|||
res->new_states(nst);
|
||||
res->set_buchi();
|
||||
res->set_init_state(aut->get_init_state_number());
|
||||
bool deterministic = aut->is_deterministic();
|
||||
bool deterministic = aut->prop_deterministic();
|
||||
|
||||
std::vector<unsigned> state_map(aut->num_states());
|
||||
for (unsigned n = 0; n < scc_max; ++n)
|
||||
|
|
@ -307,7 +307,7 @@ namespace spot
|
|||
static twa_graph_ptr
|
||||
rabin_to_buchi_maybe(const const_twa_graph_ptr& aut)
|
||||
{
|
||||
if (!aut->has_state_based_acc())
|
||||
if (!aut->prop_state_acc())
|
||||
return nullptr;
|
||||
|
||||
auto code = aut->get_acceptance();
|
||||
|
|
@ -468,7 +468,7 @@ namespace spot
|
|||
// We will modify res in place, and the resulting
|
||||
// automaton will only have one acceptance set.
|
||||
acc_cond::mark_t all_acc = res->set_buchi();
|
||||
res->prop_state_based_acc(true);
|
||||
res->prop_state_acc(true);
|
||||
res->prop_deterministic(true);
|
||||
|
||||
unsigned sink = res->num_states();
|
||||
|
|
@ -508,7 +508,7 @@ namespace spot
|
|||
return std::const_pointer_cast<twa_graph>(aut);
|
||||
|
||||
// FIXME: we should check whether the automaton is weak.
|
||||
if (aut->is_inherently_weak() && is_deterministic(aut))
|
||||
if (aut->prop_inherently_weak() && is_deterministic(aut))
|
||||
return remove_fin_det_weak(aut);
|
||||
|
||||
if (auto maybe = streett_to_generalized_buchi_maybe(aut))
|
||||
|
|
@ -668,7 +668,7 @@ namespace spot
|
|||
res->set_acceptance(aut->num_sets() + extra_sets, new_code);
|
||||
res->set_init_state(aut->get_init_state_number());
|
||||
|
||||
bool sbacc = aut->has_state_based_acc();
|
||||
bool sbacc = aut->prop_state_acc();
|
||||
scc_info si(aut);
|
||||
unsigned nscc = si.scc_count();
|
||||
std::vector<unsigned> state_map(nst);
|
||||
|
|
@ -746,7 +746,7 @@ namespace spot
|
|||
|
||||
// If the input had no Inf, the output is a state-based automaton.
|
||||
if (allinf == 0U)
|
||||
res->prop_state_based_acc(true);
|
||||
res->prop_state_acc(true);
|
||||
|
||||
res->purge_dead_states();
|
||||
trace << "before cleanup: " << res->get_acceptance() << '\n';
|
||||
|
|
|
|||
|
|
@ -26,14 +26,14 @@ namespace spot
|
|||
{
|
||||
twa_graph_ptr sbacc(twa_graph_ptr old)
|
||||
{
|
||||
if (old->has_state_based_acc())
|
||||
if (old->prop_state_acc())
|
||||
return old;
|
||||
|
||||
auto res = make_twa_graph(old->get_dict());
|
||||
res->copy_ap_of(old);
|
||||
res->copy_acceptance_of(old);
|
||||
res->prop_copy(old, {false, true, true, true});
|
||||
res->prop_state_based_acc(true);
|
||||
res->prop_state_acc(true);
|
||||
|
||||
typedef std::pair<unsigned, acc_cond::mark_t> pair_t;
|
||||
std::map<pair_t, unsigned> s2n;
|
||||
|
|
|
|||
|
|
@ -642,7 +642,7 @@ namespace spot
|
|||
if (nb_minato == nb_satoneset && !Cosimulation)
|
||||
res->prop_deterministic(true);
|
||||
if (Sba)
|
||||
res->prop_state_based_acc(true);
|
||||
res->prop_state_acc(true);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -770,7 +770,7 @@ namespace spot
|
|||
prev = next;
|
||||
direct_simulation<false, Sba> simul(res ? res : t);
|
||||
res = simul.run();
|
||||
if (res->is_deterministic())
|
||||
if (res->prop_deterministic())
|
||||
break;
|
||||
|
||||
direct_simulation<true, Sba> cosimul(res);
|
||||
|
|
|
|||
|
|
@ -620,7 +620,7 @@ namespace spot
|
|||
bool
|
||||
check_stutter_invariance(const twa_graph_ptr& aut, formula f)
|
||||
{
|
||||
bool is_stut = aut->is_stutter_invariant();
|
||||
bool is_stut = aut->prop_stutter_invariant();
|
||||
if (is_stut)
|
||||
return is_stut;
|
||||
|
||||
|
|
@ -634,7 +634,7 @@ namespace spot
|
|||
// If the automaton is deterministic, we
|
||||
// know how to complement it.
|
||||
aut->prop_deterministic(is_deterministic(aut));
|
||||
if (!aut->is_deterministic())
|
||||
if (!aut->prop_deterministic())
|
||||
return false;
|
||||
neg = remove_fin(dtwa_complement(aut));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ namespace spot
|
|||
bs2num[s] = out->new_state();
|
||||
todo.push_back(s);
|
||||
|
||||
bool sbacc = in->has_state_based_acc();
|
||||
bool sbacc = in->prop_state_acc();
|
||||
|
||||
// States of the original automaton are marked with s.pend == -1U.
|
||||
const acc_cond::mark_t orig_copy(-1U);
|
||||
|
|
@ -334,7 +334,7 @@ namespace spot
|
|||
assert(cnf.front().mark == 0U);
|
||||
res = make_twa_graph(aut->get_dict());
|
||||
res->set_init_state(res->new_state());
|
||||
res->prop_state_based_acc(true);
|
||||
res->prop_state_acc(true);
|
||||
res->prop_inherently_weak(true);
|
||||
res->prop_deterministic(true);
|
||||
res->prop_stutter_invariant(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue