ltl_to_pair.hh

Go to the documentation of this file.
00001 // ltl_to_pair.hh: this file is part of the Vaucanson project.
00002 //
00003 // Vaucanson, a generic library for finite state machines.
00004 //
00005 // Copyright (C) 2008 The Vaucanson Group.
00006 //
00007 // This program is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2
00010 // of the License, or (at your option) any later version.
00011 //
00012 // The complete GNU General Public Licence Notice can be found as the
00013 // `COPYING' file in the root directory.
00014 //
00015 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
00016 //
00017 #ifndef VCSN_ALGORITHMS_LTL_TO_PAIR_HH
00018 # define VCSN_ALGORITHMS_LTL_TO_PAIR_HH
00019 
00020 # include <map>
00021 # include <set>
00022 # include <utility>
00023 # include <string>
00024 
00025 # include <vaucanson/automata/concept/automata.hh>
00026 # include <vaucanson/automata/concept/transducer.hh>
00027 # include <vaucanson/algebra/concept/freemonoid_product.hh>
00028 # include <vaucanson/algebra/implementation/alphabets/alphabet_set.hh>
00029 # include <vaucanson/algebra/implementation/free_monoid/words.hh>
00030 
00031 // Needed for the operator<< on pairs
00032 # include <vaucanson/algebra/implementation/letter/couple_letter.hh>
00033 
00047 // INTERFACE: void ltl_to_pair(const Automaton& a, LtlToPair& b) { return vcsn::ltl_to_pair(*a, *b); }
00048 // INTERFACE: LtlToPair ltl_to_pair(const Automaton& a) { return vcsn::ltl_to_pair(*a); }
00049 
00050 namespace vcsn
00051 {
00054 
00055 
00056 
00057 
00058 
00059   // Helper to mute an FMP into its corresponding pair automaton.
00060   template <typename S, typename T>
00061   struct mute_ltl_to_pair
00062   {
00063     // The automaton type.
00064     typedef Element<S, T> automaton_t;
00065 
00066     // The free monoid product type.
00067     typedef typename automaton_t::monoid_elt_t::set_t monoid_set_elt_t;
00068 
00069     // The semiring type.
00070     typedef typename automaton_t::semiring_t semiring_t;
00071 
00072     // The first alphabet type.
00073     typedef typename monoid_set_elt_t::
00074         first_monoid_t::alphabet_t first_alphabet_t;
00075 
00076     // The second alphabet type.
00077     typedef typename monoid_set_elt_t::
00078         second_monoid_t::alphabet_t second_alphabet_t;
00079 
00080     // The first letter type.
00081     typedef typename first_alphabet_t::set_t::letter_t first_letter_t;
00082 
00083     // The second letter type.
00084     typedef typename second_alphabet_t::set_t::letter_t second_letter_t;
00085 
00086     // The return letter type.
00087     typedef std::pair<first_letter_t, second_letter_t> ret_letter_t;
00088 
00089     // The return alphabet type.
00090 
00091     // 1 - structure
00092     typedef typename algebra::AlphabetSet<ret_letter_t> ret_alphabet_set_t;
00093 
00094     // 2 - implementation
00095     typedef std::set<ret_letter_t> ret_alphabet_impl_t;
00096 
00097     // 3 - element
00098     typedef Element<ret_alphabet_set_t, ret_alphabet_impl_t>
00099         ret_alphabet_t;
00100 
00101     typedef algebra::FreeMonoid<ret_alphabet_t> ret_monoid_t;
00102 
00103     typedef Element<ret_monoid_t, std::basic_string<ret_letter_t> >
00104         ret_monoid_elt_t;
00105 
00106     // Helper to calculate the Cartesian product of two
00107     // alphabets: E = {(a,x)| a \in A, x \in B}.
00108     static ret_alphabet_t
00109     cartesian_product(const first_alphabet_t& A,
00110                       const second_alphabet_t& B);
00111 
00112     // The muted automaton type.
00113 
00114     // 1 - structure
00115     typedef typename algebra::
00116         mute_series_traits<typename automaton_t::series_set_t,
00117                            typename automaton_t::semiring_t,
00118                            algebra::FreeMonoid<ret_alphabet_t> >::ret
00119         ret_series_set_t;
00120     typedef Automata<ret_series_set_t> ret_set_t;
00121 
00122     // 2 - implementation
00123     typedef typename mute_graph_impl_monoid_traits<typename automaton_t::
00124         value_t, ret_monoid_elt_t>::ret ret_impl_t;
00125 
00126     // 3 - element
00127     typedef Element<ret_set_t, ret_impl_t> ret;
00128 
00129     // Automaton "makers".
00130     static ret
00131     make_automaton(const ret_alphabet_t&);
00132 
00133     static ret
00134     make_automaton(const automaton_t&);
00135 
00136     // Series converter.
00137     static typename ret::series_set_elt_t
00138     series_convert(const ret_series_set_t&,
00139                    const typename automaton_t::series_set_elt_t&);
00140   };
00141 
00142   template <typename S, typename T>
00143   void
00144   ltl_to_pair(const Element<S, T>& ltl,
00145               typename mute_ltl_to_pair<S, T>::ret& res);
00146 
00147   template <typename S, typename T>
00148   typename mute_ltl_to_pair<S, T>::ret
00149   ltl_to_pair(const Element<S, T>& ltl);
00150 
00152 
00155 } // ! vcsn
00156 
00157 # if !defined VCSN_USE_INTERFACE_ONLY && !defined VCSN_USE_LIB
00158 #  include <vaucanson/algorithms/ltl_to_pair.hxx>
00159 # endif // ! VCSN_USE_INTERFACE_ONLY
00160 
00161 #endif // ! VCSN_ALGORITHMS_LTL_TO_PAIR_HH

Generated on Thu Oct 9 20:22:40 2008 for Vaucanson by  doxygen 1.5.1