* 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.
This commit is contained in:
parent
0fd665f3a2
commit
e3de75f677
5 changed files with 126 additions and 4 deletions
|
|
@ -1,5 +1,10 @@
|
||||||
2004-11-02 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
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.cc,
|
||||||
src/tgbaalgos/emptiness.hh (print_tgba_run): Take the tgba*
|
src/tgbaalgos/emptiness.hh (print_tgba_run): Take the tgba*
|
||||||
argument before the tgba_run* argument (for consistency with
|
argument before the tgba_run* argument (for consistency with
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
#include "tgbaalgos/magic.hh"
|
#include "tgbaalgos/magic.hh"
|
||||||
#include "tgbaalgos/gtec/gtec.hh"
|
#include "tgbaalgos/gtec/gtec.hh"
|
||||||
#include "tgbaalgos/gtec/ce.hh"
|
#include "tgbaalgos/gtec/ce.hh"
|
||||||
|
#include "tgbaalgos/projrun.hh"
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -266,8 +267,16 @@ main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
spot::tgba_run* run = ce->accepting_run();
|
spot::tgba_run* run = ce->accepting_run();
|
||||||
// FIXME: reimplement the projection
|
if (proj)
|
||||||
spot::print_tgba_run(std::cout, prod, run);
|
{
|
||||||
|
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);
|
ce->print_stats(std::cout);
|
||||||
delete run;
|
delete run;
|
||||||
delete ce;
|
delete ce;
|
||||||
|
|
@ -301,8 +310,16 @@ main(int argc, char **argv)
|
||||||
if (compute_counter_example)
|
if (compute_counter_example)
|
||||||
{
|
{
|
||||||
spot::tgba_run* run = res->accepting_run();
|
spot::tgba_run* run = res->accepting_run();
|
||||||
// FIXME: reimplement the projection
|
if (proj)
|
||||||
spot::print_tgba_run(std::cout, prod, run);
|
{
|
||||||
|
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;
|
delete run;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ tgbaalgos_HEADERS = \
|
||||||
magic.hh \
|
magic.hh \
|
||||||
neverclaim.hh \
|
neverclaim.hh \
|
||||||
powerset.hh \
|
powerset.hh \
|
||||||
|
projrun.hh \
|
||||||
reachiter.hh \
|
reachiter.hh \
|
||||||
replayrun.hh \
|
replayrun.hh \
|
||||||
save.hh \
|
save.hh \
|
||||||
|
|
@ -53,6 +54,7 @@ libtgbaalgos_la_SOURCES = \
|
||||||
magic.cc \
|
magic.cc \
|
||||||
neverclaim.cc \
|
neverclaim.cc \
|
||||||
powerset.cc \
|
powerset.cc \
|
||||||
|
projrun.cc \
|
||||||
reachiter.cc \
|
reachiter.cc \
|
||||||
replayrun.cc \
|
replayrun.cc \
|
||||||
save.cc \
|
save.cc \
|
||||||
|
|
|
||||||
51
src/tgbaalgos/projrun.cc
Normal file
51
src/tgbaalgos/projrun.cc
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
47
src/tgbaalgos/projrun.hh
Normal file
47
src/tgbaalgos/projrun.hh
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
// 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue