spot  2.16
word.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 <spot/twaalgos/emptiness.hh>
22 
23 namespace spot
24 {
34  struct SPOT_API twa_word final
35  {
37  twa_word(const bdd_dict_ptr& dict) noexcept;
39  twa_word(const twa_run_ptr& run) noexcept;
40  ~twa_word()
41  {
42  dict_->unregister_all_my_variables(this);
43  }
44 
65  void simplify();
66 
72  void use_all_aps(bdd aps, bool positive = false);
73 
75  typedef std::list<bdd> seq_t;
78 
81  {
82  return dict_;
83  }
84 
92 
98  bool intersects(const_twa_ptr aut) const
99  {
100  return as_automaton()->intersects(aut);
101  }
102 
113  SPOT_API
114  friend std::ostream& operator<<(std::ostream& os, const twa_word& w);
115  private:
116  bdd_dict_ptr dict_;
117  };
118 
126  {
127  return std::make_shared<twa_word>(dict);
128  }
129 
133  {
134  return std::make_shared<twa_word>(run);
135  }
136 
149  SPOT_API
150  twa_word_ptr parse_word(const std::string& word, const bdd_dict_ptr& dict);
151 }
std::shared_ptr< twa_run > twa_run_ptr
Shared pointer to a twa_run.
Definition: twa.hh:38
twa_word_ptr parse_word(const std::string &word, const bdd_dict_ptr &dict)
Parse a twa_word.
std::shared_ptr< twa_word > twa_word_ptr
Shared pointer to a mutable twa_word.
Definition: fwd.hh:60
twa_word_ptr make_twa_word(const bdd_dict_ptr &dict)
Create an empty twa_word.
Definition: word.hh:125
std::shared_ptr< bdd_dict > bdd_dict_ptr
Shared pointer to a bdd_dict.
Definition: bdddict.hh:304
std::shared_ptr< const twa > const_twa_ptr
Shared pointer to a const twa.
Definition: fwd.hh:36
std::shared_ptr< twa_graph > twa_graph_ptr
Shared pointer to a mutable twa_graph.
Definition: fwd.hh:44
Definition: automata.hh:26
An infinite word stored as a lasso.
Definition: word.hh:35
twa_graph_ptr as_automaton() const
Convert the twa_word as an automaton.
friend std::ostream & operator<<(std::ostream &os, const twa_word &w)
Print a twa_word.
bool intersects(const_twa_ptr aut) const
Check if the twa_word intersects another automaton.
Definition: word.hh:98
void use_all_aps(bdd aps, bool positive=false)
Use all atomic propositions.
bdd_dict_ptr get_dict() const
Return the BDD dictionary.
Definition: word.hh:80
twa_word(const bdd_dict_ptr &dict) noexcept
Construct an empty word with the given BDD dictionary.
twa_word(const twa_run_ptr &run) noexcept
Construct a word from a twa_run.
seq_t prefix
Finite prefix of the word.
Definition: word.hh:76
void simplify()
Simplify a lasso-shaped word.
std::list< bdd > seq_t
Type for a sequence of BDD conditions.
Definition: word.hh:75
seq_t cycle
Infinite repeating cycle of the word.
Definition: word.hh:77

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.1