formula: rename the constants for consistency

False/True are problematic in Python, and I don't like that the
enum is op::False but the constructor formula::ff().  So let's
just use ff and tt everywhere, and also eword instead of EmptyWord.

* src/ltlast/formula.hh (False, True, EmptyWord, AP, is_false, is_true):
Rename to...
(ff, tt, eword, ap, is_ff, is_tt): ... these.
* iface/ltsmin/ltsmin.cc, src/ltlast/formula.cc,
src/ltlvisit/apcollect.cc, src/ltlvisit/dot.cc, src/ltlvisit/mark.cc,
src/ltlvisit/mutation.cc, src/ltlvisit/print.cc,
src/ltlvisit/relabel.cc, src/ltlvisit/simpfg.cc,
src/ltlvisit/simplify.cc, src/ltlvisit/snf.cc, src/ltlvisit/unabbrev.cc,
src/twa/acc.cc, src/twa/acc.hh, src/twa/formula2bdd.cc,
src/twaalgos/gtec/gtec.cc, src/twaalgos/hoa.cc, src/twaalgos/ltl2taa.cc,
src/twaalgos/ltl2tgba_fm.cc, src/twaalgos/neverclaim.cc,
src/twaalgos/product.cc, src/twaalgos/remfin.cc, src/twaalgos/safety.cc,
src/tests/parseerr.test, src/tests/utf8.test, wrap/python/spot.py:
Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2015-09-27 22:47:17 +02:00
parent fad05632a2
commit 8b4ec5ded0
27 changed files with 211 additions and 211 deletions

View file

@ -411,9 +411,9 @@ namespace spot
int acc_cond::is_rabin() const
{
if (code_.is_false())
if (code_.is_ff())
return num_ == 0 ? 0 : -1;
if ((num_ & 1) || code_.is_true())
if ((num_ & 1) || code_.is_tt())
return -1;
if (is_rs(code_, acc_op::Or, acc_op::And, all_sets()))
@ -424,9 +424,9 @@ namespace spot
int acc_cond::is_streett() const
{
if (code_.is_true())
if (code_.is_tt())
return num_ == 0 ? 0 : -1;
if ((num_ & 1) || code_.is_false())
if ((num_ & 1) || code_.is_ff())
return -1;
if (is_rs(code_, acc_op::And, acc_op::Or, all_sets()))
@ -444,7 +444,7 @@ namespace spot
pairs.resize(num_);
return true;
}
if (code_.is_true()
if (code_.is_tt()
|| code_.back().op != acc_op::Or)
return false;
@ -670,7 +670,7 @@ namespace spot
if (sets == 0)
{
max = true;
odd = is_true();
odd = is_tt();
return true;
}
acc_cond::mark_t u_inf;
@ -1107,7 +1107,7 @@ namespace spot
acc_cond::acc_code acc_cond::acc_code::complement() const
{
if (is_true())
if (is_tt())
return acc_cond::acc_code::f();
return complement_rec(&back());
}
@ -1169,7 +1169,7 @@ namespace spot
acc_cond::acc_code
acc_cond::acc_code::strip(acc_cond::mark_t rem, bool missing) const
{
if (is_true() || is_false())
if (is_tt() || is_ff())
return *this;
return strip_rec(&back(), rem, missing);
}
@ -1177,7 +1177,7 @@ namespace spot
acc_cond::mark_t
acc_cond::acc_code::used_sets() const
{
if (is_true() || is_false())
if (is_tt() || is_ff())
return 0U;
acc_cond::mark_t used_in_cond = 0U;
auto pos = &back();
@ -1205,7 +1205,7 @@ namespace spot
std::pair<acc_cond::mark_t, acc_cond::mark_t>
acc_cond::acc_code::used_inf_fin_sets() const
{
if (is_true() || is_false())
if (is_tt() || is_ff())
return {0U, 0U};
acc_cond::mark_t used_fin = 0U;

View file

@ -395,14 +395,14 @@ namespace spot
return !(*this == other);
}
bool is_true() const
bool is_tt() const
{
unsigned s = size();
return s == 0
|| ((*this)[s - 1].op == acc_op::Inf && (*this)[s - 2].mark == 0U);
}
bool is_false() const
bool is_ff() const
{
unsigned s = size();
return s > 1
@ -561,12 +561,12 @@ namespace spot
void append_and(acc_code&& r)
{
if (is_true() || r.is_false())
if (is_tt() || r.is_ff())
{
*this = std::move(r);
return;
}
if (is_false() || r.is_true())
if (is_ff() || r.is_tt())
return;
unsigned s = size() - 1;
unsigned rs = r.size() - 1;
@ -652,12 +652,12 @@ namespace spot
void append_and(const acc_code& r)
{
if (is_true() || r.is_false())
if (is_tt() || r.is_ff())
{
*this = r;
return;
}
if (is_false() || r.is_true())
if (is_ff() || r.is_tt())
return;
unsigned s = size() - 1;
unsigned rs = r.size() - 1;
@ -742,9 +742,9 @@ namespace spot
void append_or(acc_code&& r)
{
if (is_true() || r.is_false())
if (is_tt() || r.is_ff())
return;
if (is_false() || r.is_true())
if (is_ff() || r.is_tt())
{
*this = std::move(r);
return;
@ -894,14 +894,14 @@ namespace spot
return uses_fin_acceptance_;
}
bool is_true() const
bool is_tt() const
{
return code_.is_true();
return code_.is_tt();
}
bool is_false() const
bool is_ff() const
{
return code_.is_false();
return code_.is_ff();
}
bool is_buchi() const

View file

@ -72,11 +72,11 @@ namespace spot
};
switch (f.kind())
{
case op::False:
case op::ff:
return bddfalse;
case op::True:
case op::tt:
return bddtrue;
case op::EmptyWord:
case op::eword:
case op::Star:
case op::FStar:
case op::F:
@ -98,7 +98,7 @@ namespace spot
case op::OrRat:
case op::AndRat:
SPOT_UNIMPLEMENTED();
case op::AP:
case op::ap:
return bdd_ithvar(d->register_proposition(f, owner));
case op::Not:
return bdd_not(recurse(f[0]));