Commit 4386300e authored by Jérôme Galtier's avatar Jérôme Galtier
Browse files

Prototype law FMP.

Warning: filenames are wrong.
parent bb62f0af
// lal_z_fmp_transducer.hh: this file is part of the Vaucanson project.
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2009 The Vaucanson Group.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// The complete GNU General Public Licence Notice can be found as the
// `COPYING' file in the root directory.
//
// The Vaucanson Group consists of people listed in the `AUTHORS' file.
//
# include GRAPH_CONTEXT_HEADER_(lal_z_fmp_transducer_structures.hh)
# define VCSN_CONTEXT_NAMESPACE namespace lal_z_fmp_transducer
# define AUTOMATON_CONTEXT lal_z_automaton
# include <vaucanson/contexts/fmp_transducer_functions.thh>
# undef VCSN_CONTEXT_NAMESPACE
# undef AUTOMATON_CONTEXT
// lal_z_fmp_transducer_structures.hh: this file is part of the Vaucanson
// project.
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2009 The Vaucanson Group.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// The complete GNU General Public Licence Notice can be found as the
// `COPYING' file in the root directory.
//
// The Vaucanson Group consists of people listed in the `AUTHORS' file.
//
# include GRAPH_CONTEXT_HEADER_(lal_z_automaton_structures.hh)
# define AUTOMATON_CONTEXT lal_z_automaton
# define VCSN_CONTEXT_NAMESPACE namespace lal_z_fmp_transducer
# define VCSN_CONTEXT_NAME lal_z_fmp_transducer
namespace vcsn
{
VCSN_CONTEXT_NAMESPACE
{
typedef AUTOMATON_CONTEXT::monoid_elt_t first_monoid_elt_t;
typedef first_monoid_elt_t::set_t first_monoid_t;
typedef first_monoid_elt_t::value_t first_monoid_elt_value_t;
typedef first_monoid_t::alphabet_t first_alphabet_t;
typedef first_monoid_t::monoid_rep_t first_monoid_rep_t;
typedef AUTOMATON_CONTEXT::series_rep_t first_series_rep_t;
typedef AUTOMATON_CONTEXT::monoid_elt_t second_monoid_elt_t;
typedef second_monoid_elt_t::set_t second_monoid_t;
typedef second_monoid_elt_t::value_t second_monoid_elt_value_t;
typedef second_monoid_t::alphabet_t second_alphabet_t;
typedef second_monoid_t::monoid_rep_t second_monoid_rep_t;
typedef AUTOMATON_CONTEXT::series_rep_t second_series_rep_t;
} // End of namespace VCSN_CONTEXT_NAMESPACE.
} // End of namespace vcsn
# include <vaucanson/contexts/free_monoid_product.thh>
# include <vaucanson/contexts/z_semiring.thh>
# include <vaucanson/contexts/polynom_series.thh>
namespace vcsn
{
// FIXME: it should inherit from AutomataBase<> traits
template <typename S, typename M1, typename M2, typename K, typename T>
struct automaton_traits<Automata<algebra::Series<S, algebra::FreeMonoidProduct<M1, M2> >, K>, T>
{
typedef typename T::graph_t graph_t;
// From implementation.
typedef typename graph_t::tag_t tag_t;
typedef typename graph_t::label_t label_value_t;
typedef typename graph_t::weight_t semiring_elt_t;
typedef typename graph_t::weight_t weight_t;
typedef typename graph_t::geometry_t geometry_t;
typedef typename graph_t::vertices_t states_t;
typedef typename graph_t::vertex_iterator state_iterator;
typedef typename graph_t::edges_t transitions_t;
typedef typename graph_t::edge_iterator transition_iterator;
typedef typename graph_t::hvertex_t hstate_t;
typedef typename graph_t::hedge_t htransition_t;
//
// Initial and final (no meaning in the graph)
//
/*
** Types related to the containers returned in case we need to iterate over
** the initial and final transitions in an algorithm.
**
** We highly recommand using the Support and SupportIterator object to encapsulate
** your container.
** If you do not want to use it, then you must follow its interface.
** You can find support.h{h,xx} in vaucanson/misc/.
**
** The current implementation of Support does not support deletion upon
** iteraton. Since one usually wants to do that in Vaucanson, your
** container must support this feature. If it doesn't, we advise you to
** specialise support for your container and add the necessary.
**
** WARNING: whenever a container of one of this type is returned through an accessor,
** a copy is made. So, if you do not use the Support object, be sure to
** consider this. A copy of a Support object is free since it only
** contains a reference to the actual container.
*/
// FIXME: initial and final from listg
/*
typedef InitialContainer<hstate_t, label_t> initial_container_t;
typedef FinalContainer<hstate_t, label_t> final_container_t;
*/
// Value or element?
typedef typename T::initial_container_t::value_t initial_t;
typedef typename T::final_container_t::value_t final_t;
// Used by transpose view.
// (generic version: Initial container for listg must export initial_t and initial_support_t)
typedef typename T::initial_container_t::support_t initial_support_t;
typedef typename T::final_container_t::support_t final_support_t;
// FIXME: initial and final from bmig
/*
typedef bmig::InitialValue<vertex_t, label_t> initial_value_t;
typedef bmig::FinalValue<vertex_t, label_t> final_value_t;
typedef bmig::InitialContainer<initial_value_t, vertex_t> initial_container_t;
typedef bmig::FinalContainer<final_value_t, vertex_t> final_container_t;
*/
typedef typename initial_support_t::iterator initial_iterator;
typedef typename final_support_t::iterator final_iterator;
typedef typename graph_t::delta_iterator delta_iterator;
typedef typename graph_t::rdelta_iterator rdelta_iterator;
typedef typename semiring_elt_t::value_t semiring_elt_value_t;
// The type of letters must always be derived from the alphabet.
// Should be defined from the structure. See TransposeView for an example.
typedef S series_set_elt_structure_t;
typedef typename series_set_elt_structure_t::monoid_t::alphabet_t::letter_t letter_t;
// FIXME: labels_are_letters
typedef std::basic_string<letter_t> monoid_elt_value_t;
typedef algebra::polynom<monoid_elt_value_t,
semiring_elt_value_t> series_set_elt_value_t;
// Most general calculation type.
typedef Element<series_set_elt_structure_t,
series_set_elt_value_t> series_set_elt_t;
typedef series_set_elt_t entry_value_t;
typedef typename series_set_elt_t::monoid_elt_t monoid_elt_t;
typedef typename series_set_elt_structure_t::monoid_t monoid_elt_structure_t;
typedef typename semiring_elt_t::set_t semiring_elt_structure_t;
typedef K kind_t;
typedef typename calculate_labels<kind_t, letter_t,
series_set_elt_t>::ret label_t;
};
} // End of namespace vcsn.
# include <vaucanson/contexts/generic_fmp_impl.thh>
# include <vaucanson/contexts/law_automaton.thh>
# include <vaucanson/contexts/fmp_transducer.thh>
# include <vaucanson/contexts/fmp_transducer_maker.thh>
# undef AUTOMATON_CONTEXT
# undef VCSN_CONTEXT_NAME
# undef VCSN_CONTEXT_NAMESPACE
// -*- C++ -*-
// generic_fmp_impl.thh: this file is part of the Vaucanson project.
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2009 The Vaucanson Group.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// The complete GNU General Public Licence Notice can be found as the
// `COPYING' file in the root directory.
//
// The Vaucanson Group consists of people listed in the `AUTHORS' file.
//
/*
* CPP guard should not be inserted here as
* VCSN_CONTEXT_NAMESPACE could be changed.
*/
# include <vaucanson/misc/usual_macros.hh>
// FIXME: a concept header should not be in an implementation context
# include <vaucanson/automata/concept/tags.hh>
// Graph specializations.
# include <vaucanson/automata/implementation/list_graph.hh>
# include <vaucanson/automata/implementation/bmi_graph.hh>
# include <vaucanson/automata/implementation/automata_impl.hh>
# include <vaucanson/automata/implementation/automata_ops.hh>
namespace vcsn
{
VCSN_CONTEXT_NAMESPACE
{
// FIXME: graph implementation choice not here
typedef AutomataImpl<VertexToLabel, ListGraph<std::pair<std::basic_string<series_set_elt_t::set_t::monoid_t::first_monoid_t::letter_t>, std::basic_string<series_set_elt_t::set_t::monoid_t::second_monoid_t::letter_t> >, semiring_elt_t, NoTag, std::pair<double, double> > > automaton_impl_t;
} // end of VCSN_CONTEXT_NAMESPACE
} // end of namespace vcsn
// -*- C++ -*-
// law_automaton.thh: this file is part of the Vaucanson project.
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2009 The Vaucanson Group.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// The complete GNU General Public Licence Notice can be found as the
// `COPYING' file in the root directory.
//
// The Vaucanson Group consists of people listed in the `AUTHORS' file.
//
/*
* CPP guard should not be inserted here as
* VCSN_CONTEXT_NAMESPACE could be changed.
*/
#include <vaucanson/automata/concept/automata.hh>
namespace vcsn
{
VCSN_CONTEXT_NAMESPACE
{
typedef vcsn::labels_are_words labels_kind_t;
typedef vcsn::Automata<series_set_elt_t::set_t, labels_kind_t> automata_set_t;
typedef vcsn::Element<automata_set_t, automaton_impl_t> automaton_t;
AUTOMATON_TYPES_EXACT(automaton_t);
} // end of VCSN_CONTEXT_NAMESPACE
} // end of namespace vcsn
......@@ -31,6 +31,7 @@ include vcsn-z-min/libvcsn-z-min.mk
include vcsn-fmp-tdc/libvcsn-fmp-tdc.mk
include vcsn-tdc/libvcsn-tdc.mk
include vcsn-z-fmp-tdc/libvcsn-z-fmp-tdc.mk
include vcsn-lal-z-fmp-tdc/libvcsn-lal-z-fmp-tdc.mk
include vcsn-z-tdc/libvcsn-z-tdc.mk
include vcsn-int-fmp-tdc/libvcsn-int-fmp-tdc.mk
include vcsn-int-z-fmp-tdc/libvcsn-int-z-fmp-tdc.mk
......@@ -50,6 +51,7 @@ maintainer-clean-local:
$(top_builddir)/lib/vcsn-z-min \
$(top_builddir)/lib/vcsn-z-max \
$(top_builddir)/lib/vcsn-z-fmp-tdc \
$(top_builddir)/lib/vcsn-lal-z-fmp-tdc \
$(top_builddir)/lib/vcsn-int-z-fmp-tdc \
$(top_builddir)/lib/vcsn-z-tdc \
$(top_builddir)/lib/vcsn-fmp-tdc \
......@@ -69,6 +71,7 @@ maintainer-clean-local:
$(top_srcdir)/lib/vcsn-z-min \
$(top_srcdir)/lib/vcsn-z-max \
$(top_srcdir)/lib/vcsn-z-fmp-tdc \
$(top_srcdir)/lib/vcsn-lal-z-fmp-tdc \
$(top_srcdir)/lib/vcsn-int-z-fmp-tdc \
$(top_srcdir)/lib/vcsn-z-tdc \
$(top_srcdir)/lib/vcsn-fmp-tdc \
......
......@@ -29,6 +29,7 @@ vcsn = Hash[
"vcsn-int-fmp-tdc" => "int_fmp_transducer",
"vcsn-tdc" => "boolean_transducer",
"vcsn-z-fmp-tdc" => "z_fmp_transducer",
"vcsn-lal-z-fmp-tdc" => "lal_z_fmp_transducer",
"vcsn-int-z-fmp-tdc" => "int_z_fmp_transducer",
"vcsn-z-tdc" => "z_transducer",
"vcsn-char-char-b" => "char_char_boolean_automaton",
......@@ -113,7 +114,8 @@ def create?(type, file)
(
"vcsn-fmp-tdc" == type or "vcsn-tdc" == type or
"vcsn-z-fmp-tdc" == type or "vcsn-z-tdc" == type or
"vcsn-int-fmp-tdc" == type or "vcsn-int-z-fmp-tdc" == type
"vcsn-int-fmp-tdc" == type or "vcsn-int-z-fmp-tdc" == type or
"vcsn-lal-z-fmp-tdc" == type
) and
file !~ /aci_canonical.hh/ and
file !~ /aut_to_exp.hh/ and
......@@ -142,7 +144,8 @@ def create?(type, file)
file !~ /semantic_isomorphism.hh/ and
( # FMP transducers only filters.
not ( "vcsn-fmp-tdc" == type or "vcsn-z-fmp-tdc" == type or
"vcsn-int-fmp-tdc" == type or "vcsn-int-z-fmp-tdc" == type
"vcsn-int-fmp-tdc" == type or "vcsn-int-z-fmp-tdc" == type or
"vcsn-lal-z-fmp-tdc" == type
) or
(
file !~ /complete.hh/ and
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment