29#include <spot/misc/_config.h>
30#include <spot/misc/bitset.hh>
31#include <spot/misc/trival.hh>
44 SPOT_DEPRECATED(
"mark_t no longer relies on unsigned, stop using value_t")
45 typedef unsigned value_t;
64 [[noreturn]]
static void report_too_many_sets();
101 template<
class iterator>
102 mark_t(
const iterator& begin,
const iterator& end)
105 for (iterator i = begin; i != end; ++i)
106 if (SPOT_LIKELY(*i < SPOT_MAX_ACCSETS))
109 report_too_many_sets();
113 mark_t(std::initializer_list<unsigned> vals)
114 :
mark_t(vals.begin(), vals.end())
118 SPOT_DEPRECATED(
"use brace initialization instead")
139 return SPOT_MAX_ACCSETS;
149 return mark_t(_value_t::mone());
152 size_t hash() const noexcept
154 std::hash<
decltype(id)> h;
158 SPOT_DEPRECATED(
"compare mark_t to mark_t, not to unsigned")
159 bool operator==(
unsigned o)
const
161 SPOT_ASSERT(o == 0U);
166 SPOT_DEPRECATED(
"compare mark_t to mark_t, not to unsigned")
167 bool operator!=(
unsigned o)
const
169 SPOT_ASSERT(o == 0U);
174 bool operator==(mark_t o)
const
179 bool operator!=(mark_t o)
const
184 bool operator<(mark_t o)
const
189 bool operator<=(mark_t o)
const
194 bool operator>(mark_t o)
const
199 bool operator>=(mark_t o)
const
204 explicit operator bool()
const
209 bool has(
unsigned u)
const
211 return !!this->operator&(mark_t({0}) << u);
219 void clear(
unsigned u)
224 mark_t& operator&=(mark_t r)
230 mark_t& operator|=(mark_t r)
236 mark_t& operator-=(mark_t r)
242 mark_t& operator^=(mark_t r)
248 mark_t operator&(mark_t r)
const
258 mark_t operator-(mark_t r)
const
263 mark_t operator~()
const
268 mark_t operator^(mark_t r)
const
273#if SPOT_DEBUG || defined(SWIGPYTHON)
274# define SPOT_WRAP_OP(ins) \
279 catch (const std::runtime_error& e) \
281 report_too_many_sets(); \
284# define SPOT_WRAP_OP(ins) ins;
286 mark_t operator<<(
unsigned i)
const
288 SPOT_WRAP_OP(
return id << i);
291 mark_t& operator<<=(
unsigned i)
293 SPOT_WRAP_OP(
id <<= i;
return *
this);
296 mark_t operator>>(
unsigned i)
const
298 SPOT_WRAP_OP(
return id >> i);
301 mark_t& operator>>=(
unsigned i)
303 SPOT_WRAP_OP(
id >>= i;
return *
this);
307 mark_t strip(mark_t y)
const
321 auto rm = (~yv) & (yv - 1);
323 auto lm = ~(yv ^ (yv - 1));
324 xv = ((xv & lm) >> 1) | (xv & rm);
334 return !((*this) - m);
341 return *
this != m && this->subset(m);
357 return id.highest()+1;
369 return id.lowest()+1;
390 return id && !(
id & (
id - 1));
401 return !!(
id & (
id - 1));
416 template<
class iterator>
433 std::string as_string()
const;
438 { Inf, Fin, InfNeg, FinNeg,
And,
Or };
469 struct SPOT_API
acc_code:
public std::vector<acc_word>
474 bool operator==(
const acc_code& other)
const
477 if (is_t() && other.
is_t())
479 unsigned pos = size();
480 if (other.size() != pos)
484 auto op = (*this)[pos - 1].sub.op;
485 auto sz = (*this)[pos - 1].sub.size;
486 if (other[pos - 1].sub.op !=
op ||
487 other[pos - 1].sub.size != sz)
491 case acc_cond::acc_op::And:
492 case acc_cond::acc_op::Or:
495 case acc_cond::acc_op::Inf:
496 case acc_cond::acc_op::InfNeg:
497 case acc_cond::acc_op::Fin:
498 case acc_cond::acc_op::FinNeg:
500 if (other[pos].mark != (*
this)[pos].mark)
508 bool operator<(
const acc_code& other)
const
511 if (is_t() && other.
is_t())
513 unsigned pos = size();
514 auto osize = other.size();
521 auto op = (*this)[pos - 1].sub.op;
522 auto oop = other[pos - 1].sub.op;
527 auto sz = (*this)[pos - 1].sub.size;
528 auto osz = other[pos - 1].sub.size;
535 case acc_cond::acc_op::And:
536 case acc_cond::acc_op::Or:
539 case acc_cond::acc_op::Inf:
540 case acc_cond::acc_op::InfNeg:
541 case acc_cond::acc_op::Fin:
542 case acc_cond::acc_op::FinNeg:
545 auto m = (*this)[pos].mark;
546 auto om = other[pos].mark;
558 bool operator>(
const acc_code& other)
const
560 return other < *
this;
563 bool operator<=(
const acc_code& other)
const
565 return !(other < *
this);
568 bool operator>=(
const acc_code& other)
const
570 return !(*
this < other);
573 bool operator!=(
const acc_code& other)
const
575 return !(*
this == other);
586 return s == 0 || ((*this)[s - 1].sub.op == acc_op::Inf
587 && !((*this)[s - 2].mark));
601 && (*this)[s - 1].sub.op == acc_op::Fin && !((*this)[s - 2].mark);
615 res[1].sub.op = acc_op::Fin;
641 res[1].sub.op = acc_op::Fin;
673 res[1].sub.op = acc_op::FinNeg;
680 return fin_neg(
mark_t(vals));
697 res[1].sub.op = acc_op::Inf;
729 res[1].sub.op = acc_op::InfNeg;
736 return inf_neg(
mark_t(vals));
766 m >>= mark_t::max_accsets() - n;
780 m >>= mark_t::max_accsets() - n;
793 res |= inf({2*n - 1}) & fin({2*n - 2});
808 res &= inf({2*n - 1}) | fin({2*n - 2});
826 template<
class Iterator>
831 for (Iterator i = begin; i != end; ++i)
835 for (
unsigned ni = *i; ni > 0; --ni)
837 auto pair = inf(m) & fin({f});
838 std::swap(pair, res);
839 res |= std::move(pair);
854 return parity(
true, is_odd, sets);
858 return parity_max(
true, sets);
862 return parity_max(
false, sets);
866 return parity(
false, is_odd, sets);
870 return parity_min(
true, sets);
874 return parity_min(
false, sets);
899 if (is_t() || r.
is_f())
904 if (is_f() || r.
is_t())
906 unsigned s = size() - 1;
907 unsigned rs = r.size() - 1;
910 if (((*
this)[s].sub.op == acc_op::Inf
911 && r[rs].sub.op == acc_op::Inf)
912 || ((*
this)[s].sub.op == acc_op::InfNeg
913 && r[rs].sub.op == acc_op::InfNeg))
915 (*this)[s - 1].mark |= r[rs - 1].mark;
925 if ((*
this)[s].sub.op == acc_op::And)
927 auto start = &(*this)[s] - (*this)[s].sub.size;
928 auto pos = &(*this)[s] - 1;
932 if (pos->sub.op == acc_op::Inf)
937 pos -= pos->sub.size + 1;
940 else if ((*
this)[s].sub.op == acc_op::Inf)
942 left_inf = &(*this)[s - 1];
945 const acc_word* right_inf =
nullptr;
946 auto right_end = &r.back();
947 if (right_end->sub.op == acc_op::And)
950 auto pos = --right_end;
953 if (pos->sub.op == acc_op::Inf)
958 pos -= pos->sub.size + 1;
961 else if (right_end->sub.op == acc_op::Inf)
963 right_inf = right_end - 1;
967 if (left_inf && right_inf)
969 carry = left_inf->mark;
970 auto pos = left_inf - &(*this)[0];
971 erase(begin() + pos, begin() + pos + 2);
974 insert(end(), &r[0], right_end + 1);
976 (*this)[sz + (right_inf - &r[0])].mark |= carry;
979 w.sub.op = acc_op::And;
1006 if (is_t() || r.
is_f())
1008 if (is_f() || r.
is_t())
1013 unsigned s = size() - 1;
1014 unsigned rs = r.size() - 1;
1016 if (((*
this)[s].sub.op == acc_op::Fin
1017 && r[rs].sub.op == acc_op::Fin)
1018 || ((*
this)[s].sub.op == acc_op::FinNeg
1019 && r[rs].sub.op == acc_op::FinNeg))
1021 (*this)[s - 1].mark |= r[rs - 1].mark;
1031 if ((*
this)[s].sub.op == acc_op::Or)
1033 auto start = &(*this)[s] - (*this)[s].sub.size;
1034 auto pos = &(*this)[s] - 1;
1038 if (pos->sub.op == acc_op::Fin)
1043 pos -= pos->sub.size + 1;
1046 else if ((*
this)[s].sub.op == acc_op::Fin)
1048 left_fin = &(*this)[s - 1];
1051 const acc_word* right_fin =
nullptr;
1052 auto right_end = &r.back();
1053 if (right_end->sub.op == acc_op::Or)
1056 auto pos = --right_end;
1059 if (pos->sub.op == acc_op::Fin)
1061 right_fin = pos - 1;
1064 pos -= pos->sub.size + 1;
1067 else if (right_end->sub.op == acc_op::Fin)
1069 right_fin = right_end - 1;
1073 if (left_fin && right_fin)
1075 carry = left_fin->mark;
1076 auto pos = (left_fin - &(*this)[0]);
1077 this->erase(begin() + pos, begin() + pos + 2);
1080 insert(end(), &r[0], right_end + 1);
1082 (*this)[sz + (right_fin - &r[0])].mark |= carry;
1084 w.sub.op = acc_op::Or;
1085 w.sub.size = size();
1115 if (SPOT_UNLIKELY(sets >= mark_t::max_accsets()))
1116 report_too_many_sets();
1119 unsigned pos = size();
1122 switch ((*
this)[pos - 1].sub.op)
1124 case acc_cond::acc_op::And:
1125 case acc_cond::acc_op::Or:
1128 case acc_cond::acc_op::Inf:
1129 case acc_cond::acc_op::InfNeg:
1130 case acc_cond::acc_op::Fin:
1131 case acc_cond::acc_op::FinNeg:
1133 (*this)[pos].mark <<= sets;
1313 std::tuple<int, acc_cond::acc_code, acc_cond::acc_code>
1315 std::tuple<int, acc_cond::acc_code, acc_cond::acc_code>
1331 std::vector<std::vector<int>>
1357 mark_t always_present)
const;
1408 std::vector<std::pair<acc_cond::mark_t, acc_cond::mark_t>>
1428 std::function<
void(std::ostream&,
int)>
1429 set_printer =
nullptr)
const;
1437 std::function<
void(std::ostream&,
int)>
1438 set_printer =
nullptr)
const;
1446 std::function<
void(std::ostream&,
int)>
1447 set_printer =
nullptr)
const;
1482 : std::vector<
acc_word>(other - other->sub.size, other + 1)
1496 : num_(0U), all_({}), code_(code)
1499 uses_fin_acceptance_ = check_fin_acceptance();
1507 : num_(0
U), all_({}), code_(code)
1509 add_sets(code.used_sets().max_set());
1510 uses_fin_acceptance_ = check_fin_acceptance();
1515 : num_(o.num_), all_(o.all_), code_(o.code_),
1516 uses_fin_acceptance_(o.uses_fin_acceptance_)
1526 uses_fin_acceptance_ = o.uses_fin_acceptance_;
1540 uses_fin_acceptance_ = check_fin_acceptance();
1555 bool operator==(
const acc_cond& other)
const
1561 return (ocode == code_ || (ocode.is_t() && code_.is_t()));
1564 bool operator!=(
const acc_cond& other)
const
1566 return !(*
this == other);
1572 return uses_fin_acceptance_;
1578 return code_.is_t();
1587 return num_ == 0 && is_t();
1593 return code_.is_f();
1602 return num_ == 0 && is_f();
1611 unsigned s = code_.size();
1613 s == 2 && code_[1].sub.op == acc_op::Inf && code_[0].mark == all_sets();
1622 return num_ == 1 && is_generalized_co_buchi();
1629 set_acceptance(inf(all_sets()));
1636 set_acceptance(fin(all_sets()));
1645 unsigned s = code_.size();
1646 return (s == 0 && num_ == 0) || (s == 2 && code_[1].sub.op == acc_op::Inf
1647 && code_[0].mark == all_sets());
1656 unsigned s = code_.size();
1658 code_[1].sub.op == acc_op::Fin && code_[0].mark == all_sets());
1711 bool operator==(
rs_pair o)
const
1713 return fin == o.fin && inf == o.inf;
1715 bool operator!=(
rs_pair o)
const
1717 return fin != o.fin || inf != o.inf;
1719 bool operator<(
rs_pair o)
const
1721 return fin < o.fin || (!(o.fin < fin) && inf < o.inf);
1723 bool operator<=(
rs_pair o)
const
1725 return !(o < *
this);
1727 bool operator>(
rs_pair o)
const
1731 bool operator>=(
rs_pair o)
const
1733 return !(*
this < o);
1794 bool is_parity(
bool& max,
bool& odd,
bool equiv =
false)
const;
1803 return is_parity(max, odd);
1815 return acc_cond(num_, code_.unit_propagation());
1821 std::pair<bool, acc_cond::mark_t> unsat_mark()
const
1823 return sat_unsat_mark(
false);
1828 std::pair<bool, acc_cond::mark_t> sat_mark()
const
1830 return sat_unsat_mark(
true);
1834 bool check_fin_acceptance()
const;
1835 std::pair<bool, acc_cond::mark_t> sat_unsat_mark(
bool)
const;
1848 return acc_code::inf(mark);
1853 return inf(
mark_t(vals.begin(), vals.end()));
1875 return acc_code::inf_neg(mark);
1880 return inf_neg(
mark_t(vals.begin(), vals.end()));
1893 return acc_code::fin(mark);
1898 return fin(
mark_t(vals.begin(), vals.end()));
1920 return acc_code::fin_neg(mark);
1925 return fin_neg(
mark_t(vals.begin(), vals.end()));
1939 if (num > mark_t::max_accsets())
1940 report_too_many_sets();
1959 SPOT_ASSERT(u < num_sets());
1982 return code_.accepting(inf);
1992 return code_.inf_satisfiable(inf);
2008 return code_.maybe_accepting(infinitely_often, always_present);
2027 SPOT_DEPRECATED(
"Use operator<< instead.")
2028 std::ostream& format(std::ostream& os,
mark_t m) const;
2031 SPOT_DEPRECATED("Use operator<< or
mark_t::as_string() instead.")
2032 std::
string format(
mark_t m) const;
2035 unsigned num_sets()
const
2047 template<
class iterator>
2051 for (
unsigned x = 0; x < num_; ++x)
2056 auto all = comp(u |
mark_t({x}));
2059 for (iterator y = begin; y != end; ++y)
2089 return {num_sets(), code_.
remove(rem, missing)};
2099 { num_sets() - (all_sets() & rem).count(), code_.
strip(rem, missing) };
2105 return {num_sets(), code_.
force_inf(m)};
2112 return {num_sets(), code_.
remove(all_sets() - rem,
true)};
2126 std::string
name(
const char* fmt =
"alo")
const;
2143 return code_.fin_unit();
2160 return code_.mafins();
2176 return code_.inf_unit();
2185 return code_.fin_one();
2210 auto [f, c] = code_.fin_one_extract();
2211 return {f, {num_sets(), std::move(c)}};
2232 std::tuple<int, acc_cond, acc_cond>
2235 auto [f, l, r] = code_.fin_unit_one_split();
2236 return {f, {num_sets(), std::move(l)}, {num_sets(), std::move(r)}};
2238 std::tuple<int, acc_cond, acc_cond>
2241 auto [f, l, r] = code_.fin_unit_one_split_improved();
2242 return {f, {num_sets(), std::move(l)}, {num_sets(), std::move(r)}};
2275 bool uses_fin_acceptance_ =
false;
2280 typedef std::vector<acc_cond::rs_pair> rs_pairs;
2284 : pairs_(p), view_marks_(m) {}
2310 return !visible(p.inf) && visible(p.fin) ? p.fin
2319 return !visible(p.fin) && visible(p.inf) ? p.inf
2327 for (
const auto& p: pairs_)
2328 if (p.fin.has(mark) && visible(p.fin) && visible(p.inf))
2333 const rs_pairs& pairs()
const
2339 template<
typename filter>
2343 for (
const auto& p: pairs_)
2350 return !!(view_marks_ & v);
2353 const rs_pairs& pairs_;
2359 std::ostream& operator<<(std::ostream& os,
const acc_cond& acc);
2371 std::ostream& operator<<(std::ostream& os,
2381 typedef unsigned value_type;
2382 typedef const value_type& reference;
2383 typedef const value_type* pointer;
2384 typedef std::ptrdiff_t difference_type;
2385 typedef std::forward_iterator_tag iterator_category;
2407 value_type operator*()
const
2410 return m_.min_set() - 1;
2415 m_.clear(this->
operator*());
2459 struct hash<
spot::acc_cond::mark_t>
An acceptance condition.
Definition: acc.hh:61
const acc_code & get_acceptance() const
Retrieve the acceptance formula.
Definition: acc.hh:1544
bool inf_satisfiable(mark_t inf) const
Assuming that we will visit at least all sets in inf, is there any chance that we will satisfy the co...
Definition: acc.hh:1990
mark_t all_sets() const
Construct a mark_t with all declared sets.
Definition: acc.hh:1973
static acc_code fin_neg(mark_t mark)
Construct a generalized co-Büchi acceptance for complemented sets.
Definition: acc.hh:1918
mark_t mafins() const
Find a Fin(i) that is mandatory.
Definition: acc.hh:2158
static acc_code inf_neg(mark_t mark)
Construct a generalized Büchi acceptance for complemented sets.
Definition: acc.hh:1873
acc_cond unit_propagation()
Remove superfluous Fin and Inf by unit propagation.
Definition: acc.hh:1813
void set_generalized_co_buchi()
Change the acceptance condition to generalized-co-Büchi, over all declared sets.
Definition: acc.hh:1634
std::pair< int, acc_cond > fin_one_extract() const
Return one acceptance set i that appears as Fin(i) in the condition, and all disjuncts containing it ...
Definition: acc.hh:2208
static acc_code fin(mark_t mark)
Construct a generalized co-Büchi acceptance.
Definition: acc.hh:1891
bool is_co_buchi() const
Whether the acceptance condition is "co-Büchi".
Definition: acc.hh:1620
bool accepting(mark_t inf) const
Check whether visiting exactly all sets inf infinitely often satisfies the acceptance condition.
Definition: acc.hh:1980
static acc_code inf(mark_t mark)
Construct a generalized Büchi acceptance.
Definition: acc.hh:1846
bool is_generalized_buchi() const
Whether the acceptance condition is "generalized-Büchi".
Definition: acc.hh:1643
static acc_code fin_neg(std::initializer_list< unsigned > vals)
Construct a generalized co-Büchi acceptance for complemented sets.
Definition: acc.hh:1923
static acc_code inf(std::initializer_list< unsigned > vals)
Construct a generalized Büchi acceptance.
Definition: acc.hh:1851
unsigned add_set()
Add a single set to the acceptance condition.
Definition: acc.hh:1951
bool is_parity(bool &max, bool &odd, bool equiv=false) const
check is the acceptance condition matches one of the four type of parity acceptance defined in the HO...
std::vector< acc_cond > top_disjuncts() const
Return the top-level disjuncts.
mark_t mark(unsigned u) const
Build a mark_t with a single set.
Definition: acc.hh:1957
void set_generalized_buchi()
Change the acceptance condition to generalized-Büchi, over all declared sets.
Definition: acc.hh:1627
acc_cond force_inf(mark_t m) const
For all x in m, replaces Fin(x) by false.
Definition: acc.hh:2103
acc_cond remove(mark_t rem, bool missing) const
Remove all the acceptance sets in rem.
Definition: acc.hh:2087
acc_op
Operators for acceptance formulas.
Definition: acc.hh:438
acc_cond(unsigned n_sets=0, const acc_code &code={})
Build an acceptance condition.
Definition: acc.hh:1495
unsigned add_sets(unsigned num)
Add more sets to the acceptance condition.
Definition: acc.hh:1933
bool is_parity() const
check is the acceptance condition matches one of the four type of parity acceptance defined in the HO...
Definition: acc.hh:1799
bool is_t() const
Whether the acceptance formula is "t" (true)
Definition: acc.hh:1576
bool is_generalized_rabin(std::vector< unsigned > &pairs) const
Is the acceptance condition generalized-Rabin?
mark_t comp(const mark_t &l) const
Complement a mark_t.
Definition: acc.hh:1967
acc_cond & operator=(const acc_cond &o)
Copy an acceptance condition.
Definition: acc.hh:1521
acc_code & get_acceptance()
Retrieve the acceptance formula.
Definition: acc.hh:1550
static acc_code fin(std::initializer_list< unsigned > vals)
Construct a generalized co-Büchi acceptance.
Definition: acc.hh:1896
bool is_generalized_co_buchi() const
Whether the acceptance condition is "generalized-co-Büchi".
Definition: acc.hh:1654
std::tuple< int, acc_cond, acc_cond > fin_unit_one_split_improved() const
Split an acceptance condition, trying to select one unit-Fin.
Definition: acc.hh:2239
acc_cond restrict_to(mark_t rem) const
Restrict an acceptance condition to a subset of set numbers that are occurring at some point.
Definition: acc.hh:2110
trival maybe_accepting(mark_t infinitely_often, mark_t always_present) const
Check potential acceptance of an SCC.
Definition: acc.hh:2006
std::string name(const char *fmt="alo") const
Return the name of this acceptance condition, in the specified format.
bool is_none() const
Whether the acceptance condition is "none".
Definition: acc.hh:1600
void set_acceptance(const acc_code &code)
Change the acceptance formula.
Definition: acc.hh:1537
int is_rabin() const
Check if the acceptance condition matches the Rabin acceptance of the HOA format.
bool is_rabin_like(std::vector< rs_pair > &pairs) const
Test whether an acceptance condition is Rabin-like and returns each Rabin pair in an std::vector<rs_p...
mark_t accepting_sets(mark_t inf) const
Return an accepting subset of inf.
bool is_all() const
Whether the acceptance condition is "all".
Definition: acc.hh:1585
acc_cond strip(mark_t rem, bool missing) const
Remove acceptance sets, and shift set numbers.
Definition: acc.hh:2096
int fin_one() const
Return one acceptance set i that appear as Fin(i) in the condition.
Definition: acc.hh:2183
mark_t useless(iterator begin, iterator end) const
Compute useless acceptance sets given a list of mark_t that occur in an SCC.
Definition: acc.hh:2048
int is_streett() const
Check if the acceptance condition matches the Streett acceptance of the HOA format.
mark_t fin_unit() const
Find a Fin(i) that is a unit clause.
Definition: acc.hh:2141
bool is_generalized_streett(std::vector< unsigned > &pairs) const
Is the acceptance condition generalized-Streett?
acc_cond(const acc_code &code)
Build an acceptance condition.
Definition: acc.hh:1506
acc_cond(const acc_cond &o)
Copy an acceptance condition.
Definition: acc.hh:1514
static acc_code inf_neg(std::initializer_list< unsigned > vals)
Construct a generalized Büchi acceptance for complemented sets.
Definition: acc.hh:1878
bool is_streett_like(std::vector< rs_pair > &pairs) const
Test whether an acceptance condition is Streett-like and returns each Streett pair in an std::vector<...
bool is_buchi() const
Whether the acceptance condition is "Büchi".
Definition: acc.hh:1609
std::vector< acc_cond > top_conjuncts() const
Return the top-level conjuncts.
std::tuple< int, acc_cond, acc_cond > fin_unit_one_split() const
Split an acceptance condition, trying to select one unit-Fin.
Definition: acc.hh:2233
mark_t inf_unit() const
Find a Inf(i) that is a unit clause.
Definition: acc.hh:2174
bool uses_fin_acceptance() const
Whether the acceptance condition uses Fin terms.
Definition: acc.hh:1570
bool is_f() const
Whether the acceptance formula is "f" (false)
Definition: acc.hh:1591
unsigned num_sets() const
The number of sets used in the acceptance condition.
Definition: acc.hh:2035
A class implementing Kleene's three-valued logic.
Definition: trival.hh:33
op
Operator types.
Definition: formula.hh:78
@ And
(omega-Rational) And
Definition: automata.hh:26
const mc_rvalue operator|(const mc_rvalue &lhs, const mc_rvalue &rhs)
This function helps to find the output value from a set of threads that may have different values.
Definition: mc.hh:130
An acceptance formula.
Definition: acc.hh:470
static acc_code parity_max(bool is_odd, unsigned sets)
Build a parity acceptance condition.
Definition: acc.hh:852
std::tuple< int, acc_cond::acc_code, acc_cond::acc_code > fin_unit_one_split() const
Split an acceptance condition, trying to select one unit-Fin.
std::vector< std::vector< int > > missing(mark_t inf, bool accepting) const
Help closing accepting or rejecting cycle.
mark_t mafins() const
Find a Fin(i) that is mandatory.
std::ostream & to_html(std::ostream &os, std::function< void(std::ostream &, int)> set_printer=nullptr) const
Print the acceptance formula as HTML.
static acc_code inf(mark_t m)
Construct a generalized Büchi acceptance.
Definition: acc.hh:692
acc_code to_cnf() const
Convert the acceptance formula into disjunctive normal form.
acc_code operator&(acc_code &&r) const
Conjunct the current condition with r.
Definition: acc.hh:995
acc_code force_inf(mark_t m) const
For all x in m, replaces Fin(x) by false.
static acc_code inf_neg(std::initializer_list< unsigned > vals)
Construct a generalized Büchi acceptance for complemented sets.
Definition: acc.hh:734
std::vector< std::pair< acc_cond::mark_t, acc_cond::mark_t > > useless_colors_patterns() const
Find patterns of useless colors.
trival maybe_accepting(mark_t infinitely_often, mark_t always_present) const
Check potential acceptance of an SCC.
acc_code operator|(const acc_code &r) const
Disjunct the current condition with r.
Definition: acc.hh:1101
std::vector< acc_code > top_conjuncts() const
Return the top-level conjuncts.
acc_code operator|(acc_code &&r) const
Disjunct the current condition with r.
Definition: acc.hh:1092
static acc_code fin(std::initializer_list< unsigned > vals)
Construct a generalized co-Büchi acceptance.
Definition: acc.hh:646
bool is_dnf() const
Whether the acceptance formula is in disjunctive normal form.
std::vector< acc_code > top_disjuncts() const
Return the top-level disjuncts.
acc_code operator&(const acc_code &r) const
Conjunct the current condition with r.
Definition: acc.hh:986
static acc_code inf(std::initializer_list< unsigned > vals)
Construct a generalized Büchi acceptance.
Definition: acc.hh:702
static acc_code parity_min_even(unsigned sets)
Build a parity acceptance condition.
Definition: acc.hh:872
static acc_code parity(bool is_max, bool is_odd, unsigned sets)
Build a parity acceptance condition.
mark_t used_once_sets() const
Return the sets that appears only once in the acceptance.
acc_code & operator<<=(unsigned sets)
Apply a left shift to all mark_t that appear in the condition.
Definition: acc.hh:1113
bool is_f() const
Is this the "false" acceptance condition?
Definition: acc.hh:596
static acc_code generalized_buchi(unsigned n)
Build a generalized-Büchi acceptance condition with n sets.
Definition: acc.hh:761
static acc_code parity_min_odd(unsigned sets)
Build a parity acceptance condition.
Definition: acc.hh:868
acc_code(const acc_word *other)
Copy a part of another acceptance formula.
Definition: acc.hh:1481
mark_t fin_unit() const
Find a Fin(i) that is a unit clause.
static acc_code parity_max_even(unsigned sets)
Build a parity acceptance condition.
Definition: acc.hh:860
static acc_code f()
Construct the "false" acceptance condition.
Definition: acc.hh:610
bool accepting(mark_t inf) const
Check whether visiting exactly all sets inf infinitely often satisfies the acceptance condition.
static acc_code parity_max_odd(unsigned sets)
Build a parity acceptance condition.
Definition: acc.hh:856
std::ostream & to_latex(std::ostream &os, std::function< void(std::ostream &, int)> set_printer=nullptr) const
Print the acceptance formula as LaTeX.
std::pair< int, acc_code > fin_one_extract() const
Return one acceptance set i that appears as Fin(i) in the condition, and all disjuncts containing it ...
bool is_t() const
Is this the "true" acceptance condition?
Definition: acc.hh:582
acc_code operator<<(unsigned sets) const
Apply a left shift to all mark_t that appear in the condition.
Definition: acc.hh:1144
static acc_code random(unsigned n, double reuse=0.0)
Build a random acceptance condition.
static acc_code rabin(unsigned n)
Build a Rabin condition with n pairs.
Definition: acc.hh:788
acc_code()
Build an empty acceptance formula.
Definition: acc.hh:1476
std::tuple< int, acc_cond::acc_code, acc_cond::acc_code > fin_unit_one_split_improved() const
Split an acceptance condition, trying to select one unit-Fin.
static acc_code cobuchi()
Build a co-Büchi acceptance condition.
Definition: acc.hh:751
acc_code complement() const
Complement an acceptance formula.
static acc_code inf_neg(mark_t m)
Construct a generalized Büchi acceptance for complemented sets.
Definition: acc.hh:724
bdd to_bdd(const bdd *map) const
Convert the acceptance formula into a BDD.
std::ostream & to_text(std::ostream &os, std::function< void(std::ostream &, int)> set_printer=nullptr) const
Print the acceptance formula as text.
int fin_one() const
Return one acceptance set i that appears as Fin(i) in the condition.
acc_cond::mark_t used_sets() const
Return the set of sets appearing in the condition.
std::pair< acc_cond::mark_t, acc_cond::mark_t > used_inf_fin_sets() const
Return the sets used as Inf or Fin in the acceptance condition.
acc_code strip(acc_cond::mark_t rem, bool missing) const
Remove acceptance sets, and shift set numbers.
acc_code(const char *input)
Construct an acc_code from a string.
static acc_code fin_neg(std::initializer_list< unsigned > vals)
Construct a generalized co-Büchi acceptance for complemented sets.
Definition: acc.hh:678
acc_code & operator&=(const acc_code &r)
Conjunct the current condition in place with r.
Definition: acc.hh:897
mark_t inf_unit() const
Find a Inf(i) that is a unit clause.
static acc_code streett(unsigned n)
Build a Streett condition with n pairs.
Definition: acc.hh:803
static acc_code t()
Construct the "true" acceptance condition.
Definition: acc.hh:624
std::vector< unsigned > symmetries() const
compute the symmetry class of the acceptance sets.
static acc_code fin_neg(mark_t m)
Construct a generalized co-Büchi acceptance for complemented sets.
Definition: acc.hh:668
static acc_code parity_min(bool is_odd, unsigned sets)
Build a parity acceptance condition.
Definition: acc.hh:864
static acc_code fin(mark_t m)
Construct a generalized co-Büchi acceptance.
Definition: acc.hh:636
acc_code & operator|=(const acc_code &r)
Disjunct the current condition in place with r.
Definition: acc.hh:1004
bool inf_satisfiable(mark_t inf) const
Assuming that we will visit at least all sets in inf, is there any chance that we will satisfy the co...
bool is_cnf() const
Whether the acceptance formula is in conjunctive normal form.
static acc_code buchi()
Build a Büchi acceptance condition.
Definition: acc.hh:743
static acc_code generalized_co_buchi(unsigned n)
Build a generalized-co-Büchi acceptance condition with n sets.
Definition: acc.hh:775
acc_code remove(acc_cond::mark_t rem, bool missing) const
Remove all the acceptance sets in rem.
acc_code to_dnf() const
Convert the acceptance formula into disjunctive normal form.
static acc_code generalized_rabin(Iterator begin, Iterator end)
Build a generalized Rabin condition.
Definition: acc.hh:827
An acceptance mark.
Definition: acc.hh:84
static constexpr unsigned max_accsets()
The maximum number of acceptance sets supported by this implementation.
Definition: acc.hh:137
bool is_singleton() const
Whether the mark contains only one bit set.
Definition: acc.hh:384
mark_t lowest() const
A mark_t where all bits have been removed except the lowest one.
Definition: acc.hh:378
unsigned max_set() const
The number of the highest set used plus one.
Definition: acc.hh:354
mark_t & remove_some(unsigned n)
Remove n bits that where set.
Definition: acc.hh:408
static mark_t all()
A mark_t with all bits set to one.
Definition: acc.hh:147
spot::internal::mark_container sets() const
Returns some iterable object that contains the used sets.
Definition: acc.hh:2450
bool proper_subset(mark_t m) const
Whether the set of bits represented by *this is a proper subset of those represented by m.
Definition: acc.hh:339
mark_t(const iterator &begin, const iterator &end)
Create a mark_t from a range of set numbers.
Definition: acc.hh:102
unsigned count() const
Number of bits sets.
Definition: acc.hh:345
mark_t()=default
Initialize an empty mark_t.
mark_t(std::initializer_list< unsigned > vals)
Create a mark_t from a list of set numbers.
Definition: acc.hh:113
bool has_many() const
Whether the mark contains at least two bits set.
Definition: acc.hh:395
unsigned min_set() const
The number of the lowest set used plus one.
Definition: acc.hh:366
bool subset(mark_t m) const
Whether the set of bits represented by *this is a subset of those represented by m.
Definition: acc.hh:332
void fill(iterator here) const
Fill a container with the indices of the bits that are set.
Definition: acc.hh:417
Rabin/streett pairs used by is_rabin_like and is_streett_like.
Definition: acc.hh:1697
A "node" in an acceptance formulas.
Definition: acc.hh:448