Commit bc06418a authored by Pierre-Yves Angrand's avatar Pierre-Yves Angrand Committed by Alexandre Duret-Lutz
Browse files

Add new example automata.

* data/automata/char-zmin/slowbig.cc,
data/automata/char-zmax/maxblocka.cc: New files.
* data/automata/char-zmin/Makefile.am,
data/automata/char-zmax/Makefile.am: Adjust.
* data/automata/char-zmin/minab.cc,
data/automata/char-zmax/maxab.cc: Fix reference to ETA.
parent 746cbc63
2011-09-27 Pierre-Yves Angrand <pangrand@gmail.com>
Add new example automata.
* data/automata/char-zmin/slowbig.cc,
data/automata/char-zmax/maxblocka.cc: New files.
* data/automata/char-zmin/Makefile.am,
data/automata/char-zmax/Makefile.am: Adjust.
* data/automata/char-zmin/minab.cc,
data/automata/char-zmax/maxab.cc: Fix reference to ETA.
2011-09-25 Alexandre Duret-Lutz <adl@lrde.epita.fr>
 
Handle execvp() failures.
......
......@@ -17,10 +17,11 @@ include $(top_srcdir)/vaucanson.mk
LDADD = $(top_builddir)/lib/libvcsn-common.la
AM_CPPFLAGS += -DBENCH_DISABLED
noinst_PROGRAMS = maxab gag
noinst_PROGRAMS = maxab maxblocka gag
nodist_char_zmin_automata_DATA = \
maxab.xml \
maxblocka.xml \
gag.xml
CLEANFILES += $(nodist_char_zmin_automata_DATA)
......@@ -32,6 +33,13 @@ maxab.xml: maxab$(EXEEXT)
./maxab$(EXEEXT) xml >$@.tmp
mv $@.tmp $@
maxblocka_CPPFLAGS = $(AM_CPPFLAGS)
maxblocka_SOURCES = maxblocka.cc
maxblocka.xml: maxblocka$(EXEEXT)
./maxblocka$(EXEEXT) xml >$@.tmp
mv $@.tmp $@
gag_CPPFLAGS = $(AM_CPPFLAGS)
gag_SOURCES = gag.cc
......
......@@ -20,8 +20,7 @@ using namespace vcsn;
using namespace vcsn::z_max_plus_automaton;
#include <vaucanson/tools/dumper.hh>
// This automaton comes from ETA p. 435, example 2.5. With {a,b}
// changed into {0,1}.
// This automaton comes from EAT p. 407, example 2.7.
int
main(int argc, char **argv)
......
// maxbloca.cc: this file is part of the Vaucanson project.
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2011 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 <vaucanson/z_max_plus_automaton.hh>
using namespace vcsn;
using namespace vcsn::z_max_plus_automaton;
#include <vaucanson/tools/dumper.hh>
int
main(int argc, char **argv)
{
alphabet_t A;
A.insert('a');
A.insert('b');
monoid_t Astar (A);
monoid_elt_t a (Astar, "a");
monoid_elt_t b (Astar, "b");
//
//
//
automaton_t maxbloca = make_automaton(A);
hstate_t p = maxbloca.add_state();
hstate_t q = maxbloca.add_state();
hstate_t r = maxbloca.add_state();
series_set_elt_t pp (maxbloca.structure().series());
pp.assoc(a, 0);
pp.assoc(b, 0);
maxbloca.add_series_transition(p, p, pp);
series_set_elt_t pq (maxbloca.structure().series());
pq.assoc(b, 0);
maxbloca.add_series_transition(p, q, pq);
series_set_elt_t qq (maxbloca.structure().series());
qq.assoc(a, 1);
maxbloca.add_series_transition(q, q, qq);
series_set_elt_t qr (maxbloca.structure().series());
qr.assoc(b, 0);
maxbloca.add_series_transition(q, r, qr);
series_set_elt_t rr (maxbloca.structure().series());
rr.assoc(a, 0);
rr.assoc(b, 0);
maxbloca.add_series_transition(r, r, rr);
maxbloca.set_initial(p); maxbloca.set_initial(q);
maxbloca.set_final(q); maxbloca.set_final(r);
tools::dumper(argc, argv)(std::cout, maxbloca, "maxbloca");
}
......@@ -17,14 +17,22 @@ include $(top_srcdir)/vaucanson.mk
LDADD = $(top_builddir)/lib/libvcsn-common.la
AM_CPPFLAGS += -DBENCH_DISABLED
noinst_PROGRAMS = minab sag
noinst_PROGRAMS = slowbig minab sag
nodist_char_zmin_automata_DATA = \
slowbig.xml \
minab.xml \
sag.xml
CLEANFILES += $(nodist_char_zmin_automata_DATA)
slowbig_CPPFLAGS = $(AM_CPPFLAGS)
slowbig_SOURCES = slowbig.cc
slowbig.xml: slowbig$(EXEEXT)
./slowbig$(EXEEXT) xml >$@.tmp
mv $@.tmp $@
minab_CPPFLAGS = $(AM_CPPFLAGS)
minab_SOURCES = minab.cc
......
......@@ -20,8 +20,7 @@ using namespace vcsn;
using namespace vcsn::z_min_plus_automaton;
#include <vaucanson/tools/dumper.hh>
// This automaton comes from ETA p. 435, example 2.5. With {a,b}
// changed into {0,1}.
// This automaton comes from EAT p. 407, example 2.7.
int
main(int argc, char **argv)
......
// slowbig.cc: this file is part of the Vaucanson project.
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2005, 2006, 2009, 2011 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 <vaucanson/z_min_plus_automaton.hh>
using namespace vcsn;
using namespace vcsn::z_min_plus_automaton;
#include <vaucanson/tools/dumper.hh>
int
main(int argc, char **argv)
{
alphabet_t A;
A.insert('a');
A.insert('b');
monoid_t Astar (A);
monoid_elt_t a (Astar, "a");
monoid_elt_t b (Astar, "b");
//
//
//
automaton_t slowbig = make_automaton(A);
hstate_t p = slowbig.add_state();
hstate_t q = slowbig.add_state();
hstate_t r = slowbig.add_state();
series_set_elt_t pp (slowbig.structure().series());
pp.assoc(a, 0);
pp.assoc(b, 0);
slowbig.add_series_transition(p, p, pp);
series_set_elt_t pq (slowbig.structure().series());
pq.assoc(b, 0);
slowbig.add_series_transition(p, q, pq);
series_set_elt_t qq (slowbig.structure().series());
qq.assoc(a, 1);
slowbig.add_series_transition(q, q, qq);
series_set_elt_t qr (slowbig.structure().series());
qr.assoc(b, 0);
slowbig.add_series_transition(q, r, qr);
series_set_elt_t rr (slowbig.structure().series());
rr.assoc(a, 0);
slowbig.add_series_transition(r, r, rr);
series_set_elt_t rq (slowbig.structure().series());
rq.assoc(a, 1);
slowbig.add_series_transition(r, q, rq);
slowbig.set_initial(p);
slowbig.set_initial(q);
slowbig.set_initial(r);
slowbig.set_final(r);
tools::dumper(argc, argv)(std::cout, slowbig, "slowbig");
}
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