Commit 9fa4d218 authored by Sarah O'Connor's avatar Sarah O'Connor
Browse files

2005-06-03 Sarah O'Connor <sarah.o-connor@lrde.epita.fr>

	* include/vaucanson/z_transducer.hh: New. Add a context header for
	transducers on Z semiring.
	* include/Makefile.am: Update accordingly.

	* include/vaucanson/contexts/fmp_transducer_functions.thh,
	* include/vaucanson/contexts/fmp_transducer_functions.thxx: Modify
	'make_couple' function to return a monoid_elt_t instead of a
	series_elt_t.
	* src/tests/context_headers/fmp_transducers/global_consistency_test.hh:
	Update accordingly.

	* src/tests/test-suites/context_headers_z_transducer.defs: New.
	Instantiate a test for the new context header.
	* src/tests/test-suites/z_transducer.defs: New. Instantiate a test on
	transducers on Z semiring.

	* src/tests/test-suites/z_fmp_transducer.defs: New. Instantiate a test
	on fmp transducers on Z semiring.
	* src/tests/test-suites/generate-all.sh: Update accordingly.

	* src/tests/automata/algos/fmp_transducers/instantiation_test.hh:
	Remove useless test.
	* src/tests/automata/algos/fmp_transducers/Makefile.am: Update
	accordingly.
parent be350a0d
2005-06-03 Sarah O'Connor <sarah.o-connor@lrde.epita.fr>
* include/vaucanson/z_transducer.hh: New. Add a context header for
transducers on Z semiring.
* include/Makefile.am: Update accordingly.
* include/vaucanson/contexts/fmp_transducer_functions.thh,
* include/vaucanson/contexts/fmp_transducer_functions.thxx: Modify
'make_couple' function to return a monoid_elt_t instead of a
series_elt_t.
* src/tests/context_headers/fmp_transducers/global_consistency_test.hh:
Update accordingly.
* src/tests/test-suites/context_headers_z_transducer.defs: New.
Instantiate a test for the new context header.
* src/tests/test-suites/z_transducer.defs: New. Instantiate a test on
transducers on Z semiring.
* src/tests/test-suites/z_fmp_transducer.defs: New. Instantiate a test
on fmp transducers on Z semiring.
* src/tests/test-suites/generate-all.sh: Update accordingly.
* src/tests/automata/algos/fmp_transducers/instantiation_test.hh:
Remove useless test.
* src/tests/automata/algos/fmp_transducers/Makefile.am: Update
accordingly.
2005-06-01 Louis-Noel Pouchet <louis-noel.pouchet@lrde.epita.fr>
 
* include/vaucanson/algorithms/sub_normalize.hh,
* include/vaucanson/algorithms/sub_normalize.hxx: Minor fix.
 
2005-05-27 Florent Terrones <florent.terrones@lrde.epita.fr>
* include/vaucanson/xml/XML.hh: Add the attribute 'name_' to the
structure 'XML' so as to store the automaton name during the XML
session.
......@@ -14,7 +41,7 @@
* include/vaucanson/tools/xml_load.hxx: New. Add 'xml_load' tool to
fill an automaton from a IStream containing XML data.
* include/Makefile.am: Update accordingly.
2005-05-26 Louis-Noel Pouchet <louis-noel.pouchet@lrde.epita.fr>
 
* include/Makefile.am: Add missing files.
......@@ -23,11 +50,11 @@
 
* include/vaucanson/xml/tools.hxx: Fix a bug with boolean automata.
* src/tests/xml/b_ref.dot: Update accordingly.
2005-05-25 Louis-Noel Pouchet <louis-noel.pouchet@lrde.epita.fr>
 
* include/vaucanson/algorithms/sub_normalize.hh,
* include/vaucanson/algorithms/sub_normalize.hxx: New. Add
* include/vaucanson/algorithms/sub_normalize.hxx: New. Add
sub-normalization for FMP transducers.
 
* src/tests/automata/algos/fmp_transducers/sub_normalize_test.hh: New.
......@@ -78,7 +105,7 @@
* src/tests/algebra/series/krat/main/krat_exp_derivation_test.hh:
Remove. This test is useless as
`src/tests/algebra/series/krat/derivations/derivation/*' do the
same, in a more complete way.
same, in a more complete way.
* src/tests/algebra/series/krat/main/Makefile.am: Update accordingly.
 
2005-05-23 Robert Bigaignon <bigaig_r@lrde.epita.fr>
......
......@@ -347,6 +347,7 @@ nobase_include_HEADERS = \
vaucanson/vaucanson.hh \
vaucanson/boolean_automaton.hh \
vaucanson/boolean_transducer.hh \
vaucanson/z_transducer.hh \
vaucanson/fmp_transducer.hh \
vaucanson/z_fmp_transducer.hh \
vaucanson/contexts/automaton_functions.thh \
......
......@@ -51,18 +51,18 @@ namespace vcsn
const SecondInputIterator second_end);
template <class T1, class T2>
series_set_elt_t make_couple(const T1& first_alphabet,
const T2& second_alphabet,
const std::string& first_exp = "",
const std::string& second_exp = "");
monoid_elt_t make_couple(const T1& first_alphabet,
const T2& second_alphabet,
const std::string& first_exp = "",
const std::string& second_exp = "");
template <class FirstIterator, class SecondIterator>
series_set_elt_t make_couple(const FirstIterator first_begin,
const FirstIterator first_end,
const SecondIterator second_begin,
const SecondIterator second_end,
const std::string& first_exp,
const std::string& second_exp);
monoid_elt_t make_couple(const FirstIterator first_begin,
const FirstIterator first_end,
const SecondIterator second_begin,
const SecondIterator second_end,
const std::string& first_exp,
const std::string& second_exp);
} // End of namespace VCSN_CONTEXT_NAMESPACE.
......
......@@ -76,12 +76,12 @@ namespace vcsn
}
template <class FirstIterator, class SecondIterator>
series_set_elt_t make_couple(const FirstIterator first_begin,
const FirstIterator first_end,
const SecondIterator second_begin,
const SecondIterator second_end,
const std::string& first_exp,
const std::string& second_exp)
monoid_elt_t make_couple(const FirstIterator first_begin,
const FirstIterator first_end,
const SecondIterator second_begin,
const SecondIterator second_end,
const std::string& first_exp,
const std::string& second_exp)
{
first_alphabet_t first_alpha;
for (FirstIterator e = first_begin; e != first_end; ++e)
......@@ -91,25 +91,17 @@ namespace vcsn
for (SecondIterator e = second_begin; e != second_end; ++e)
second_alpha.insert(*e);
semiring_t semiring;
monoid_t freemonoidproduct (first_alpha, second_alpha);
series_set_t series (semiring, freemonoidproduct);
series_set_elt_t series_elt(series);
monoid_elt_value_t fmp_elt (first_exp, second_exp);
semiring_elt_value_t semiring_elt = true;
series_elt.assoc(fmp_elt, semiring_elt);
monoid_t fmp (first_alpha, second_alpha);
return series_elt;
monoid_elt_value_t fmp_elt_value (first_exp, second_exp);
return Element<monoid_t, monoid_elt_value_t> (fmp, fmp_elt_value);
}
template <class T1, class T2>
series_set_elt_t make_couple(const T1& first_alphabet,
const T2& second_alphabet,
const std::string& first_exp,
const std::string& second_exp)
monoid_elt_t make_couple(const T1& first_alphabet,
const T2& second_alphabet,
const std::string& first_exp,
const std::string& second_exp)
{
return make_couple(first_alphabet.begin(), first_alphabet.end(),
second_alphabet.begin(), second_alphabet.end(),
......
// instantiation_test.hh: this file is part of the Vaucanson project.
// z_transducer.hh: this file is part of the Vaucanson project.
//
// Vaucanson, a generic library for finite state machines.
// Copyright (C) 2005 The Vaucanson Group.
......@@ -30,89 +30,55 @@
// * Louis-Noel Pouchet <louis-noel.pouchet@lrde.epita.fr>
//
#ifndef VCSN_TESTS_FMP_TRANSDUCERS_INSTANTIATION_TEST_HH
# define VCSN_TESTS_FMP_TRANSDUCERS_INSTANTIATION_TEST_HH
#ifndef VCSN_Z_TRANSDUCER_HH
# define VCSN_Z_TRANSDUCER_HH
# include <vaucanson/misc/static.hh>
# include <vaucanson/algebra/implementation/free_monoid_product/freemonoid_product_pair_str.hh>
# include <vaucanson/z_automaton.hh>
# include <vaucanson/boolean_automaton.hh>
using namespace vcsn;
using namespace vcsn::fmp_transducer;
# define VCSN_CONTEXT_NAMESPACE z_transducer
# define TYPE_OK(T1, T2) utility::static_eq<T1, typename Automaton::T2>::value
# define TEST_TYPE(T1, T2) \
TEST(t, #T1 " is consistent.", TYPE_OK(T1, T2))
# include <vaucanson/contexts/char_letter.thh>
# include <vaucanson/contexts/dynamic_alphabet.thh>
# include <vaucanson/contexts/free_monoid.thh>
template <class Automaton>
bool
instantiation_test(tests::Tester& t)
namespace vcsn
{
TEST_TYPE(first_alphabet_t, monoid_t::first_monoid_t::alphabet_t);
TEST_TYPE(second_alphabet_t, monoid_t::second_monoid_t::alphabet_t);
TEST_TYPE(first_monoid_t, monoid_t::first_monoid_t);
TEST_TYPE(second_monoid_t, monoid_t::second_monoid_t);
TEST_TYPE(monoid_t, monoid_t);
TEST_TYPE(semiring_t, semiring_t);
TEST_TYPE(series_set_t, series_set_t);
TEST_TYPE(automata_set_t, set_t);
bool test_done = false;
first_alphabet_t first_at;
first_at.insert('a');
first_at.insert('b');
second_alphabet_t second_at;
second_at.insert('x');
second_at.insert('y');
namespace VCSN_CONTEXT_NAMESPACE
{
typedef z_automaton::semiring_elt_t output_semiring_elt_t;
typedef output_semiring_elt_t::set_t output_semiring_t;
typedef output_semiring_elt_t::value_t output_semiring_elt_value_t;
first_monoid_t first_md (first_at);
second_monoid_t second_md (second_at);
typedef z_automaton::rat_exp_t output_series_set_elt_t;
typedef output_series_set_elt_t::set_t output_series_set_t;
typedef output_series_set_elt_t::value_t output_series_set_elt_value_t;
monoid_t fmp(first_md, second_md);
} // End of namespace VCSN_CONTEXT_NAMESPACE.
semiring_t sg;
series_set_t ss (sg, fmp);
automata_set_t aa (ss);
} // End of namespace vcsn.
while (not test_done)
try
{
automaton_t t1(aa);
# include <vaucanson/contexts/ratseries_semiring.thh>
# include <vaucanson/contexts/polynom_series.thh>
# include <vaucanson/contexts/generic_automaton_impl.thh>
# include <vaucanson/contexts/transducer.thh>
series_set_elt_t series_elt1(ss);
series_set_elt_t series_elt2(ss);
monoid_elt_value_t fmp_elt1 =
fmp.choose(SELECT(monoid_elt_value_t)).value();
monoid_elt_value_t fmp_elt2 =
fmp.choose(SELECT(monoid_elt_value_t)).value();
semiring_elt_value_t semi_elt = true;
series_elt1.assoc(fmp_elt1, semi_elt);
series_elt2.assoc(fmp_elt2, semi_elt);
namespace vcsn
{
hstate_t s = t1.add_state();
hstate_t t = t1.add_state();
hstate_t u = t1.add_state();
namespace VCSN_CONTEXT_NAMESPACE
{
t1.set_initial(s);
t1.set_final(u);
AUTOMATON_TYPES_EXACT(automaton_t);
AUTOMATON_FREEMONOID_TYPES_EXACT(automaton_t);
hedge_t h1 = t1.add_series_edge(s, t, series_elt1);
hedge_t h2 = t1.add_series_edge(t, u, series_elt2);
} // End of namespace VCSN_CONTEXT_NAMESPACE.
test_done = true;
}
catch (...)
{
test_done = false;
}
} // End of namespace vcsn.
# include <vaucanson/contexts/transducer_functions.thh>
return t.all_passed();
}
# undef VCSN_CONTEXT_NAMESPACE
#endif // ! VCSN_TESTS_FMP_TRANSDUCERS_INSTANTIATION_TEST_HH
#endif // ! VCSN_Z_TRANSDUCER_HH
# Makefile.am
EXTRA_DIST = \
instantiation_test.hh \
normalized_composition_test.hh \
sub_normalize_test.hh
......@@ -91,13 +91,10 @@ global_consistency_test(tests::Tester& t)
monoid_elt_value_t fmp_elt ("aa", "yx");
semiring_elt_value_t semiring_elt = true;
series_set_elt_t series_elt(ss);
series_elt.assoc(fmp_elt, semiring_elt);
series_set_elt_t couple = make_couple(first_at, second_at, "aa", "yx");
monoid_elt_t couple = make_couple(first_at, second_at, "aa", "yx");
TEST(t, "make_couple works.", series_elt == couple);
TEST(t, "make_couple works.", fmp_elt == couple.value());
while (not test_done)
try
......
#include <vaucanson/z_transducer.hh>
using namespace vcsn::z_transducer;
#define TEST_STATIC_ARGS automaton_t
......@@ -117,6 +117,12 @@ done;
context_headers_boolean_transducer.defs \
../context_headers/transducers
../bin/generate-test-suite.sh \
context_headers_z_transducer \
context_headers_z_transducer.defs \
../context_headers/transducers
# FIXME: Directories labeled_graphs, label_aware_graphs and
# freemonoid_labeled_graphs are not tested.
../bin/generate-test-suite.sh \
......@@ -125,6 +131,11 @@ done;
../automata/implementation_check ../automata/algos/graphs \
../automata/algos/series_multiplicity_transducers
../bin/generate-test-suite.sh \
z_transducer \
z_transducer.defs \
../automata/implementation_check ../automata/algos/graphs \
../automata/algos/series_multiplicity_transducers
../bin/generate-test-suite.sh \
context_headers_fmp_transducer \
......@@ -142,3 +153,8 @@ done;
fmp_transducer \
fmp_transducer.defs \
../automata/algos/fmp_transducers
../bin/generate-test-suite.sh \
z_fmp_transducer \
z_fmp_transducer.defs \
../automata/algos/fmp_transducers
#include <vaucanson/z_fmp_transducer.hh>
#define TEST_STATIC_ARGS \
vcsn::z_fmp_transducer::automaton_t
#include <vaucanson/z_transducer.hh>
#define TEST_STATIC_ARGS \
vcsn::z_transducer::automaton_t
#ifdef CREATE_SEMIRING
# undef CREATE_SEMIRING
# define CREATE_SEMIRING(m) \
vcsn::z_automaton::semiring_t(), m
#endif
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