spot 2.11.6.dev
Loading...
Searching...
No Matches
twa.hh
1// -*- coding: utf-8 -*-
2// Copyright (C) by the Spot authors, see the AUTHORS file for details.
3//
4// This file is part of Spot, a model checking library.
5//
6// Spot is free software; you can redistribute it and/or modify it
7// under the terms of the GNU General Public License as published by
8// the Free Software Foundation; either version 3 of the License, or
9// (at your option) any later version.
10//
11// Spot is distributed in the hope that it will be useful, but WITHOUT
12// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14// License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19#pragma once
20
21#include <cstddef>
22#include <spot/twa/fwd.hh>
23#include <spot/twa/acc.hh>
24#include <spot/twa/bdddict.hh>
25#include <cassert>
26#include <memory>
27#include <unordered_map>
28#include <functional>
29#include <array>
30#include <vector>
31#include <spot/misc/casts.hh>
32#include <spot/misc/hash.hh>
33#include <spot/tl/formula.hh>
34#include <spot/misc/trival.hh>
35
36namespace spot
37{
38 struct twa_run;
39 typedef std::shared_ptr<twa_run> twa_run_ptr;
40
41 struct twa_word;
42 typedef std::shared_ptr<twa_word> twa_word_ptr;
43
46 class SPOT_API state
47 {
48 public:
59 virtual int compare(const state* other) const = 0;
60
80 virtual size_t hash() const = 0;
81
83 virtual state* clone() const = 0;
84
94 virtual void destroy() const
95 {
96 delete this;
97 }
98
99 protected:
106 virtual ~state()
107 {
108 }
109 };
110
124 {
125 bool
126 operator()(const state* left, const state* right) const
127 {
128 SPOT_ASSERT(left);
129 return left->compare(right) < 0;
130 }
131 };
132
147 {
148 bool
149 operator()(const state* left, const state* right) const
150 {
151 SPOT_ASSERT(left);
152 return 0 == left->compare(right);
153 }
154 };
155
171 {
172 size_t
173 operator()(const state* that) const
174 {
175 SPOT_ASSERT(that);
176 return that->hash();
177 }
178 };
179
185 typedef std::unordered_set<const state*,
187
191 template<class val>
192 using state_map = std::unordered_map<const state*, val,
194
197 class SPOT_API state_unicity_table
198 {
199 state_set m;
200 public:
201
210 const state* operator()(const state* s)
211 {
212 auto p = m.insert(s);
213 if (!p.second)
214 s->destroy();
215 return *p.first;
216 }
217
222 const state* is_new(const state* s)
223 {
224 auto p = m.insert(s);
225 if (!p.second)
226 {
227 s->destroy();
228 return nullptr;
229 }
230 return *p.first;
231 }
232
234 {
235 for (state_set::iterator i = m.begin(); i != m.end();)
236 {
237 // Advance the iterator before destroying its key. This
238 // avoids issues with old g++ implementations.
239 state_set::iterator old = i++;
240 (*old)->destroy();
241 }
242 }
243
244 size_t
245 size()
246 {
247 return m.size();
248 }
249 };
250
251
252
253 // Functions related to shared_ptr.
255
256 typedef std::shared_ptr<const state> shared_state;
257
258 inline void shared_state_deleter(state* s) { s->destroy(); }
259
274 {
275 bool
276 operator()(shared_state left,
277 shared_state right) const
278 {
279 SPOT_ASSERT(left);
280 return left->compare(right.get()) < 0;
281 }
282 };
283
302 {
303 bool
304 operator()(shared_state left,
305 shared_state right) const
306 {
307 SPOT_ASSERT(left);
308 return 0 == left->compare(right.get());
309 }
310 };
311
331 {
332 size_t
333 operator()(shared_state that) const
334 {
335 SPOT_ASSERT(that);
336 return that->hash();
337 }
338 };
339
341 typedef std::unordered_set<shared_state,
344
393 class SPOT_API twa_succ_iterator
394 {
395 public:
396 virtual
398 {
399 }
400
403
418 virtual bool first() = 0;
419
430 virtual bool next() = 0;
431
447 virtual bool done() const = 0;
448
450
453
463 virtual const state* dst() const = 0;
467 virtual bdd cond() const = 0;
470 virtual acc_cond::mark_t acc() const = 0;
471
473 };
474
475 namespace internal
476 {
482 struct SPOT_API succ_iterator
483 {
484 protected:
486 public:
487
489 it_(it)
490 {
491 }
492
493 bool operator==(succ_iterator o) const
494 {
495 return it_ == o.it_;
496 }
497
498 bool operator!=(succ_iterator o) const
499 {
500 return it_ != o.it_;
501 }
502
503 const twa_succ_iterator* operator*() const
504 {
505 return it_;
506 }
507
508 void operator++()
509 {
510 if (!it_->next())
511 it_ = nullptr;
512 }
513 };
514
515#ifndef SWIG
522 {
523 protected:
524 const twa* aut_;
526 public:
528 : aut_(aut), it_(it)
529 {
530 }
531
532 twa_succ_iterable(twa_succ_iterable&& other) noexcept
533 : aut_(other.aut_), it_(other.it_)
534 {
535 other.it_ = nullptr;
536 }
537
538 ~twa_succ_iterable(); // Defined in this file after twa
539
541 {
542 return it_->first() ? it_ : nullptr;
543 }
544
546 {
547 return nullptr;
548 }
549 };
550#endif // SWIG
551 }
552
562
565
618 class SPOT_API twa: public std::enable_shared_from_this<twa>
619 {
620 protected:
621 twa(const bdd_dict_ptr& d);
625 bdd_dict_ptr dict_;
626 public:
627
628 virtual ~twa();
629
635 virtual const state* get_init_state() const = 0;
636
644 virtual twa_succ_iterator*
645 succ_iter(const state* local_state) const = 0;
646
647#ifndef SWIG
672 succ(const state* s) const
673 {
674 return {this, succ_iter(s)};
675 }
676 #endif
677
683 {
684 if (iter_cache_)
685 delete i;
686 else
687 iter_cache_ = i;
688 }
689
706 bdd_dict_ptr get_dict() const
707 {
708 return dict_;
709 }
710
724 {
725 int res = dict_->has_registered_proposition(ap, this);
726 if (res < 0)
727 {
728 aps_.emplace_back(ap);
729 res = dict_->register_proposition(ap, this);
730 bddaps_ &= bdd_ithvar(res);
731 }
732 return res;
733 }
734
735 int register_ap(std::string ap)
736 {
737 return register_ap(formula::ap(ap));
738 }
740
744 void unregister_ap(int num);
745
758 {
759 if (!aps_.empty())
760 throw std::runtime_error("register_aps_from_dict() may not be"
761 " called on an automaton that has already"
762 " registered some AP");
763 auto& m = get_dict()->bdd_map;
764 unsigned s = m.size();
765 for (unsigned n = 0; n < s; ++n)
766 if (m[n].refs.find(this) != m[n].refs.end())
767 {
768 aps_.emplace_back(m[n].f);
769 bddaps_ &= bdd_ithvar(n);
770 }
771 }
772
775 const std::vector<formula>& ap() const
776 {
777 return aps_;
778 }
779
781 bdd ap_vars() const
782 {
783 return bddaps_;
784 }
785
792 virtual std::string format_state(const state* s) const = 0;
793
807 virtual state* project_state(const state* s,
808 const const_twa_ptr& t) const;
809
812 const acc_cond& acc() const
813 {
814 return acc_;
815 }
816
818 {
819 return acc_;
820 }
822
832 virtual bool is_empty() const;
833
845 virtual twa_run_ptr accepting_run() const;
846
858 virtual twa_word_ptr accepting_word() const;
859
866 virtual bool intersects(const_twa_ptr other) const;
867
878 virtual twa_run_ptr intersecting_run(const_twa_ptr other) const;
879
880 // (undocumented)
881 //
882 // If \a from_other is true, the returned run will be over the
883 // \a other automaton. Otherwise, the run will be over this
884 // automaton.
885 //
886 // This function was deprecated in Spot 2.8.
887 SPOT_DEPRECATED("replace a->intersecting_run(b, true) "
888 "by b->intersecting_run(a).")
889 twa_run_ptr intersecting_run(const_twa_ptr other,
890 bool from_other) const
891 {
892 if (from_other)
893 return other->intersecting_run(shared_from_this());
894 else
895 return this->intersecting_run(other);
896 }
897
901 virtual twa_word_ptr intersecting_word(const_twa_ptr other) const;
902
912 virtual twa_run_ptr exclusive_run(const_twa_ptr other) const;
913
923 virtual twa_word_ptr exclusive_word(const_twa_ptr other) const;
924
925 private:
926 acc_cond acc_;
927
928 public:
930 unsigned num_sets() const
931 {
932 return acc_.num_sets();
933 }
934
937 {
938 return acc_.get_acceptance();
939 }
940
945 void set_acceptance(unsigned num, const acc_cond::acc_code& c)
946 {
947 acc_ = acc_cond(num, c);
948 }
949
954 {
955 acc_ = c;
956 }
957
959 void copy_acceptance_of(const const_twa_ptr& a)
960 {
961 acc_ = a->acc();
962 }
963
965 void copy_ap_of(const const_twa_ptr& a)
966 {
967 for (auto f: a->ap())
968 this->register_ap(f);
969 }
970
972 void copy_named_properties_of(const const_twa_ptr& a);
973
986 void set_generalized_buchi(unsigned num)
987 {
988 acc_ = acc_cond(num, acc_cond::acc_code::generalized_buchi(num));
989 }
990
1003 void set_generalized_co_buchi(unsigned num)
1004 {
1005 acc_ = acc_cond(num, acc_cond::acc_code::generalized_co_buchi(num));
1006 }
1007
1024 {
1025 acc_ = acc_cond(1, acc_cond::acc_code::buchi());
1026 return {0};
1027 }
1028
1045 {
1046 acc_ = acc_cond(1, acc_cond::acc_code::cobuchi());
1047 return {0};
1048 }
1049
1050 private:
1051 std::vector<formula> aps_;
1052 bdd bddaps_;
1053
1055 struct bprop
1056 {
1057 trival::repr_t state_based_acc:2; // State-based acceptance.
1058 trival::repr_t inherently_weak:2; // Inherently Weak automaton.
1059 trival::repr_t weak:2; // Weak automaton.
1060 trival::repr_t terminal:2; // Terminal automaton.
1061 trival::repr_t universal:2; // Universal automaton.
1062 trival::repr_t unambiguous:2; // Unambiguous automaton.
1063 trival::repr_t stutter_invariant:2; // Stutter invariant language.
1064 trival::repr_t very_weak:2; // very-weak, or 1-weak
1065 trival::repr_t semi_deterministic:2; // semi-deterministic automaton.
1066 trival::repr_t complete:2; // Complete automaton.
1067 };
1068 union
1069 {
1070 unsigned props;
1071 bprop is;
1072 };
1073
1074 protected:
1075#ifndef SWIG
1076 // Dynamic properties, are given with a name and a destructor function.
1077 std::unordered_map<std::string,
1078 std::pair<void*,
1079 std::function<void(void*)>>> named_prop_;
1080#endif
1081 void* get_named_prop_(std::string s) const;
1082
1083 public:
1084
1085#ifndef SWIG
1101 void set_named_prop(std::string s,
1102 void* val, std::function<void(void*)> destructor);
1103
1119 template<typename T>
1120 void set_named_prop(std::string s, T* val)
1121 {
1122 set_named_prop(s, val,
1123 [](void *p) noexcept { delete static_cast<T*>(p); });
1124 }
1125
1136 void set_named_prop(std::string s, std::nullptr_t);
1137
1153 template<typename T>
1154 T* get_named_prop(std::string s) const
1155 {
1156 if (void* p = get_named_prop_(s))
1157 return static_cast<T*>(p);
1158 else
1159 return nullptr;
1160 }
1161
1174 template<typename T>
1175 T* get_or_set_named_prop(std::string s)
1176 {
1177 if (void* p = get_named_prop_(s))
1178 return static_cast<T*>(p);
1179
1180 auto tmp = new T;
1181 set_named_prop(s, tmp);
1182 return tmp;
1183 }
1184
1185#endif
1186
1192 {
1193 // Destroy all named properties.
1194 for (auto& np: named_prop_)
1195 np.second.second(np.second.first);
1196 named_prop_.clear();
1197 }
1198
1206 {
1207 if (num_sets() == 0)
1208 return trival(true);
1209 return trival::from_repr_t(is.state_based_acc);
1210 }
1211
1217 {
1218 is.state_based_acc = val.val();
1219 }
1220
1226 {
1227 return prop_state_acc() && acc().is_buchi();
1228 }
1229
1239 {
1240 return trival::from_repr_t(is.inherently_weak);
1241 }
1242
1251 {
1252 is.inherently_weak = val.val();
1253 if (!val)
1254 is.very_weak = is.terminal = is.weak = val.val();
1255 }
1256
1269 {
1270 return trival::from_repr_t(is.terminal);
1271 }
1272
1281 {
1282 is.terminal = val.val();
1283 if (val)
1284 is.inherently_weak = is.weak = val.val();
1285 }
1286
1295 {
1296 return trival::from_repr_t(is.weak);
1297 }
1298
1308 {
1309 is.weak = val.val();
1310 if (val)
1311 is.inherently_weak = val.val();
1312 if (!val)
1313 is.very_weak = is.terminal = val.val();
1314 }
1315
1325 {
1326 return trival::from_repr_t(is.very_weak);
1327 }
1328
1337 {
1338 is.very_weak = val.val();
1339 if (val)
1340 is.weak = is.inherently_weak = val.val();
1341 }
1342
1343
1356 {
1357 return trival::from_repr_t(is.complete);
1358 }
1359
1364 {
1365 is.complete = val.val();
1366 }
1367
1380 {
1381 return trival::from_repr_t(is.universal);
1382 }
1383
1392 {
1393 is.universal = val.val();
1394 if (val)
1395 // universal implies unambiguous and semi-deterministic
1396 is.unambiguous = is.semi_deterministic = val.val();
1397 }
1398
1399 // Starting with Spot 2.4, an automaton is deterministic if it is
1400 // both universal and existential, but as we already have
1401 // twa::is_existential(), we only need to additionally record the
1402 // universal property. Before that, the deterministic property
1403 // was just a synonym for universal, hence we keep the deprecated
1404 // function prop_deterministic() with this meaning.
1405 SPOT_DEPRECATED("use prop_universal() instead")
1406 void prop_deterministic(trival val)
1407 {
1408 prop_universal(val);
1409 }
1410
1411 SPOT_DEPRECATED("use prop_universal() instead")
1412 trival prop_deterministic() const
1413 {
1414 return prop_universal();
1415 }
1416
1431 {
1432 return trival::from_repr_t(is.unambiguous);
1433 }
1434
1442 {
1443 is.unambiguous = val.val();
1444 if (!val)
1445 is.universal = val.val();
1446 }
1447
1461 {
1462 return trival::from_repr_t(is.semi_deterministic);
1463 }
1464
1472 {
1473 is.semi_deterministic = val.val();
1474 if (!val)
1475 is.universal = val.val();
1476 }
1477
1491 {
1492 return trival::from_repr_t(is.stutter_invariant);
1493 }
1494
1497 {
1498 is.stutter_invariant = val.val();
1499 }
1500
1540 struct prop_set
1541 {
1542 bool state_based;
1543 bool inherently_weak;
1544 bool deterministic;
1545 bool improve_det;
1546 bool complete;
1547 bool stutter_inv;
1548
1549 prop_set()
1550 : state_based(false),
1551 inherently_weak(false),
1552 deterministic(false),
1553 improve_det(false),
1554 complete(false),
1555 stutter_inv(false)
1556 {
1557 }
1558
1559 prop_set(bool state_based,
1560 bool inherently_weak,
1561 bool deterministic,
1562 bool improve_det,
1563 bool complete,
1564 bool stutter_inv)
1565 : state_based(state_based),
1566 inherently_weak(inherently_weak),
1567 deterministic(deterministic),
1568 improve_det(improve_det),
1569 complete(complete),
1570 stutter_inv(stutter_inv)
1571 {
1572 }
1573
1574#ifndef SWIG
1575 // The "complete" argument was added in Spot 2.4
1576 SPOT_DEPRECATED("prop_set() now takes 6 arguments")
1577 prop_set(bool state_based,
1578 bool inherently_weak,
1579 bool deterministic,
1580 bool improve_det,
1581 bool stutter_inv)
1582 : state_based(state_based),
1583 inherently_weak(inherently_weak),
1584 deterministic(deterministic),
1585 improve_det(improve_det),
1586 complete(false),
1587 stutter_inv(stutter_inv)
1588 {
1589 }
1590#endif
1591
1607 static prop_set all()
1608 {
1609 return { true, true, true, true, true, true };
1610 }
1611 };
1612
1623 void prop_copy(const const_twa_ptr& other, prop_set p)
1624 {
1625 if (p.state_based)
1626 prop_state_acc(other->prop_state_acc());
1627 if (p.inherently_weak)
1628 {
1629 prop_terminal(other->prop_terminal());
1630 prop_weak(other->prop_weak());
1631 prop_very_weak(other->prop_very_weak());
1632 prop_inherently_weak(other->prop_inherently_weak());
1633 }
1634 if (p.deterministic)
1635 {
1636 prop_universal(other->prop_universal());
1637 prop_semi_deterministic(other->prop_semi_deterministic());
1638 prop_unambiguous(other->prop_unambiguous());
1639 }
1640 else if (p.improve_det)
1641 {
1642 if (other->prop_universal().is_true())
1643 {
1644 prop_universal(true);
1645 }
1646 else
1647 {
1648 if (other->prop_semi_deterministic().is_true())
1649 prop_semi_deterministic(true);
1650 if (other->prop_unambiguous().is_true())
1651 prop_unambiguous(true);
1652 }
1653 }
1654 if (p.complete)
1655 prop_complete(other->prop_complete());
1656 if (p.stutter_inv)
1657 prop_stutter_invariant(other->prop_stutter_invariant());
1658 }
1659
1665 void prop_keep(prop_set p)
1666 {
1667 if (!p.state_based)
1668 prop_state_acc(trival::maybe());
1669 if (!p.inherently_weak)
1670 {
1671 prop_terminal(trival::maybe());
1672 prop_weak(trival::maybe());
1673 prop_very_weak(trival::maybe());
1674 prop_inherently_weak(trival::maybe());
1675 }
1676 if (!p.deterministic)
1677 {
1678 if (!(p.improve_det && prop_universal().is_true()))
1679 prop_universal(trival::maybe());
1680 if (!(p.improve_det && prop_semi_deterministic().is_true()))
1681 prop_semi_deterministic(trival::maybe());
1682 if (!(p.improve_det && prop_unambiguous().is_true()))
1683 prop_unambiguous(trival::maybe());
1684 }
1685 if (!p.complete)
1686 prop_complete(trival::maybe());
1687 if (!p.stutter_inv)
1688 prop_stutter_invariant(trival::maybe());
1689 }
1690
1691 void prop_reset()
1692 {
1693 prop_keep({});
1694 }
1695 };
1696
1697#ifndef SWIG
1698 namespace internal
1699 {
1700 inline twa_succ_iterable::~twa_succ_iterable()
1701 {
1702 if (it_)
1703 aut_->release_iter(it_);
1704 }
1705 }
1706#endif // SWIG
1707
1710
1713
1716
1719
1722
1725
1728
1731
1734
1737}
An acceptance condition.
Definition acc.hh:61
const acc_code & get_acceptance() const
Retrieve the acceptance formula.
Definition acc.hh:1555
unsigned num_sets() const
The number of sets used in the acceptance condition.
Definition acc.hh:2057
Main class for temporal logic formula.
Definition formula.hh:732
Helper class to iterate over the successors of a state using the on-the-fly interface.
Definition twa.hh:522
Render state pointers unique via a hash table.
Definition twa.hh:198
const state * operator()(const state *s)
Canonicalize state pointer.
Definition twa.hh:210
const state * is_new(const state *s)
Canonicalize state pointer.
Definition twa.hh:222
Abstract class for states.
Definition twa.hh:47
virtual state * clone() const =0
Duplicate a state.
virtual size_t hash() const =0
Hash a state.
virtual void destroy() const
Release a state.
Definition twa.hh:94
virtual ~state()
Destructor.
Definition twa.hh:106
virtual int compare(const state *other) const =0
Compares two states (that come from the same automaton).
A class implementing Kleene's three-valued logic.
Definition trival.hh:33
Iterate over the successors of a state.
Definition twa.hh:394
virtual acc_cond::mark_t acc() const =0
Get the acceptance mark of the edge leading to this successor.
virtual bool done() const =0
Check whether the iteration is finished.
virtual const state * dst() const =0
Get the destination state of the current edge.
virtual bool first()=0
Position the iterator on the first successor (if any).
virtual bool next()=0
Jump to the next successor (if any).
virtual bdd cond() const =0
Get the condition on the edge leading to this successor.
A Transition-based ω-Automaton.
Definition twa.hh:619
void prop_terminal(trival val)
Set the terminal property.
Definition twa.hh:1280
void copy_acceptance_of(const const_twa_ptr &a)
Copy the acceptance condition of another TωA.
Definition twa.hh:959
void set_acceptance(unsigned num, const acc_cond::acc_code &c)
Set the acceptance condition of the automaton.
Definition twa.hh:945
virtual twa_run_ptr intersecting_run(const_twa_ptr other) const
Return an accepting run recognizing a word accepted by two automata.
void prop_inherently_weak(trival val)
Set the "inherently weak" property.
Definition twa.hh:1250
trival prop_universal() const
Whether the automaton is universal.
Definition twa.hh:1379
void set_generalized_buchi(unsigned num)
Set generalized Büchi acceptance.
Definition twa.hh:986
acc_cond::mark_t set_buchi()
Set Büchi acceptance.
Definition twa.hh:1023
void set_generalized_co_buchi(unsigned num)
Set generalized co-Büchi acceptance.
Definition twa.hh:1003
const acc_cond & acc() const
The acceptance condition of the automaton.
Definition twa.hh:812
void release_named_properties()
Destroy all named properties.
Definition twa.hh:1191
void set_named_prop(std::string s, void *val, std::function< void(void *)> destructor)
Declare a named property.
virtual state * project_state(const state *s, const const_twa_ptr &t) const
Project a state on an automaton.
T * get_named_prop(std::string s) const
Retrieve a named property.
Definition twa.hh:1154
bdd_dict_ptr dict_
BDD dictionary used by the automaton.
Definition twa.hh:625
void prop_weak(trival val)
Set the weak property.
Definition twa.hh:1307
trival prop_unambiguous() const
Whether the automaton is unambiguous.
Definition twa.hh:1430
trival prop_stutter_invariant() const
Whether the automaton is stutter-invariant.
Definition twa.hh:1490
void set_named_prop(std::string s, std::nullptr_t)
Erase a named property.
virtual twa_succ_iterator * succ_iter(const state *local_state) const =0
Get an iterator over the successors of local_state.
bdd ap_vars() const
The set of atomic propositions as a conjunction.
Definition twa.hh:781
virtual const state * get_init_state() const =0
Get the initial state of the automaton.
void set_named_prop(std::string s, T *val)
Declare a named property.
Definition twa.hh:1120
virtual twa_run_ptr accepting_run() const
Return an accepting run if one exists.
void prop_stutter_invariant(trival val)
Set the stutter-invariant property.
Definition twa.hh:1496
void copy_named_properties_of(const const_twa_ptr &a)
Copy all the named properties of a into this automaton.
trival prop_terminal() const
Whether the automaton is terminal.
Definition twa.hh:1268
trival prop_state_acc() const
Whether the automaton uses state-based acceptance.
Definition twa.hh:1205
void set_acceptance(const acc_cond &c)
Set the acceptance condition of the automaton.
Definition twa.hh:953
void copy_ap_of(const const_twa_ptr &a)
Copy the atomic propositions of another TωA.
Definition twa.hh:965
trival prop_inherently_weak() const
Whether the automaton is inherently weak.
Definition twa.hh:1238
void prop_semi_deterministic(trival val)
Set the semi-deterministic property.
Definition twa.hh:1471
unsigned num_sets() const
Number of acceptance sets used by the automaton.
Definition twa.hh:930
virtual twa_word_ptr exclusive_word(const_twa_ptr other) const
Return a word accepted by exactly one of the two automata.
void prop_complete(trival val)
Set the complete property.
Definition twa.hh:1363
void prop_unambiguous(trival val)
Set the unambiguous property.
Definition twa.hh:1441
T * get_or_set_named_prop(std::string s)
Create or retrieve a named property.
Definition twa.hh:1175
void unregister_ap(int num)
Unregister an atomic proposition.
trival prop_very_weak() const
Whether the automaton is very-weak.
Definition twa.hh:1324
virtual std::string format_state(const state *s) const =0
Format the state as a string for printing.
acc_cond::mark_t set_co_buchi()
Set co-Büchi acceptance.
Definition twa.hh:1044
void prop_very_weak(trival val)
Set the very-weak property.
Definition twa.hh:1336
void prop_state_acc(trival val)
Set the state-based-acceptance property.
Definition twa.hh:1216
trival prop_complete() const
Whether the automaton is complete.
Definition twa.hh:1355
bdd_dict_ptr get_dict() const
Get the dictionary associated to the automaton.
Definition twa.hh:706
trival prop_weak() const
Whether the automaton is weak.
Definition twa.hh:1294
trival is_sba() const
Whether this is a state-based Büchi automaton.
Definition twa.hh:1225
const acc_cond::acc_code & get_acceptance() const
Acceptance formula used by the automaton.
Definition twa.hh:936
void prop_universal(trival val)
Set the universal property.
Definition twa.hh:1391
virtual bool is_empty() const
Check whether the language of the automaton is empty.
static prop_set all()
A structure for selecting a set of automaton properties to copy.
Definition twa.hh:1607
acc_cond & acc()
The acceptance condition of the automaton.
Definition twa.hh:817
void register_aps_from_dict()
Register all atomic propositions that have already been registered by the bdd_dict for this automaton...
Definition twa.hh:757
virtual twa_run_ptr exclusive_run(const_twa_ptr other) const
Return an accepting run recognizing a word accepted by exactly one of the two automata.
virtual twa_word_ptr accepting_word() const
Return an accepting word if one exists.
trival prop_semi_deterministic() const
Whether the automaton is semi-deterministic.
Definition twa.hh:1460
virtual twa_word_ptr intersecting_word(const_twa_ptr other) const
Return a word accepted by two automata.
void release_iter(twa_succ_iterator *i) const
Release an iterator after usage.
Definition twa.hh:682
int register_ap(std::string ap)
Register an atomic proposition designated by ap.
Definition twa.hh:735
twa_succ_iterator * iter_cache_
Any iterator returned via release_iter.
Definition twa.hh:623
const std::vector< formula > & ap() const
The vector of atomic propositions registered by this automaton.
Definition twa.hh:775
virtual bool intersects(const_twa_ptr other) const
Check whether the language of this automaton intersects that of the other automaton.
internal::twa_succ_iterable succ(const state *s) const
Build an iterable over the successors of s.
Definition twa.hh:672
int register_ap(formula ap)
Register an atomic proposition designated by ap.
Definition twa.hh:723
LTL/PSL formula interface.
@ ap
Atomic proposition.
Definition automata.hh:26
void prop_keep(prop_set p)
Keep only a subset of properties of the current automaton.
Definition twa.hh:1665
std::unordered_set< shared_state, state_shared_ptr_hash, state_shared_ptr_equal > shared_state_set
Unordered set of shared states.
Definition twa.hh:343
void prop_copy(const const_twa_ptr &other, prop_set p)
Copy the properties of another automaton.
Definition twa.hh:1623
std::unordered_map< const state *, val, state_ptr_hash, state_ptr_equal > state_map
Unordered map of abstract states.
Definition twa.hh:193
std::unordered_set< const state *, state_ptr_hash, state_ptr_equal > state_set
Unordered set of abstract states.
Definition twa.hh:186
twa_graph_ptr complete(const const_twa_ptr &aut)
Clone a twa and complete it.
An acceptance formula.
Definition acc.hh:478
An acceptance mark.
Definition acc.hh:84
Helper structure to iterate over the successors of a state using the on-the-fly interface.
Definition twa.hh:483
An Equivalence Relation for state*.
Definition twa.hh:147
Hash Function for state*.
Definition twa.hh:171
Strict Weak Ordering for state*.
Definition twa.hh:124
An Equivalence Relation for shared_state (shared_ptr<const state*>).
Definition twa.hh:302
Hash Function for shared_state (shared_ptr<const state*>).
Definition twa.hh:331
Strict Weak Ordering for shared_state (shared_ptr<const state*>).
Definition twa.hh:274

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Fri Feb 27 2015 10:00:07 for spot by doxygen 1.9.8