Commit e3de75f6 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

* src/tgbaalgos/projrun.hh, src/tgbaalgos/projrun.cc: New files.

* src/tgbaalgos/Makefile.am (tgbaalgos_HEADERS,
libtgbaalgos_la_SOURCES): Add them.
* iface/gspn/ltlgspn.cc (main): Call project_tgba_run if -P.
parent 0fd665f3
2004-11-02 Alexandre Duret-Lutz <adl@src.lip6.fr>
* src/tgbaalgos/projrun.hh, src/tgbaalgos/projrun.cc: New files.
* src/tgbaalgos/Makefile.am (tgbaalgos_HEADERS,
libtgbaalgos_la_SOURCES): Add them.
* iface/gspn/ltlgspn.cc (main): Call project_tgba_run if -P.
* src/tgbaalgos/emptiness.cc,
src/tgbaalgos/emptiness.hh (print_tgba_run): Take the tgba*
argument before the tgba_run* argument (for consistency with
......
......@@ -37,6 +37,7 @@
#include "tgbaalgos/magic.hh"
#include "tgbaalgos/gtec/gtec.hh"
#include "tgbaalgos/gtec/ce.hh"
#include "tgbaalgos/projrun.hh"
void
......@@ -266,8 +267,16 @@ main(int argc, char **argv)
}
#endif
spot::tgba_run* run = ce->accepting_run();
// FIXME: reimplement the projection
spot::print_tgba_run(std::cout, prod, run);
if (proj)
{
spot::tgba_run* p = project_tgba_run(prod, model, run);
spot::print_tgba_run(std::cout, model, p);
delete p;
}
else
{
spot::print_tgba_run(std::cout, prod, run);
}
ce->print_stats(std::cout);
delete run;
delete ce;
......@@ -301,8 +310,16 @@ main(int argc, char **argv)
if (compute_counter_example)
{
spot::tgba_run* run = res->accepting_run();
// FIXME: reimplement the projection
spot::print_tgba_run(std::cout, prod, run);
if (proj)
{
spot::tgba_run* p = project_tgba_run(prod, model, run);
spot::print_tgba_run(std::cout, model, p);
delete p;
}
else
{
spot::print_tgba_run(std::cout, prod, run);
}
delete run;
}
else
......
......@@ -36,6 +36,7 @@ tgbaalgos_HEADERS = \
magic.hh \
neverclaim.hh \
powerset.hh \
projrun.hh \
reachiter.hh \
replayrun.hh \
save.hh \
......@@ -53,6 +54,7 @@ libtgbaalgos_la_SOURCES = \
magic.cc \
neverclaim.cc \
powerset.cc \
projrun.cc \
reachiter.cc \
replayrun.cc \
save.cc \
......
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
//
// This file is part of Spot, a model checking library.
//
// Spot 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.
//
// Spot is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Spot; see the file COPYING. If not, write to the Free
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
#include "projrun.hh"
#include "tgba/tgba.hh"
#include "tgbaalgos/emptiness.hh"
namespace spot
{
tgba_run*
project_tgba_run(const tgba* a_run, const tgba* a_proj, const tgba_run* run)
{
tgba_run* res = new tgba_run;
for (tgba_run::steps::const_iterator i = run->prefix.begin();
i != run->prefix.end(); ++i)
{
tgba_run::step s = { a_run->project_state(i->s, a_proj),
i->label,
i->acc };
res->prefix.push_back(s);
}
for (tgba_run::steps::const_iterator i = run->cycle.begin();
i != run->cycle.end(); ++i)
{
tgba_run::step s = { a_run->project_state(i->s, a_proj),
i->label,
i->acc };
res->cycle.push_back(s);
}
return res;
}
}
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
//
// This file is part of Spot, a model checking library.
//
// Spot 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.
//
// Spot is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Spot; see the file COPYING. If not, write to the Free
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
#ifndef SPOT_TGBAALGOS_PROJRUN_HH
# define SPOT_TGBAALGOS_PROJRUN_HH
#include <iosfwd>
namespace spot
{
struct tgba_run;
class tgba;
/// \brief Project a tgba_run on a tgba.
///
/// If a tgba_run has been generated on a product, or any other
/// on-the-fly algorithm with tgba operands,
///
/// \param run the run to replay
/// \param a_run the automata on which the run was generated
/// \param a_proj the automata on which to project the run
/// \param os the stream on which the replay should be traced
/// \return true iff the run could be completed
tgba_run* project_tgba_run(const tgba* a_run,
const tgba* a_proj,
const tgba_run* run);
}
#endif // SPOT_TGBAALGOS_PROJRUN_HH
Markdown is supported
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