* src/tgbaalgos/emptinesscheck.cc (emptiness_check::check2):
New function, variant of emptiness_check::check(). * src/tgbaalgos/emptinesscheck.hh (emptiness_check::check2): Likewise. * src/tgbatest/emptchk.test, src/tgbatest/emptchke.test: Exercize -e2. * src/tgbatest/ltl2tgba.cc: Support -e2, for emptiness_check::check2(). * iface/gspn/Makefile.am [WITH_GSPN_EESRG] (check_PROGRAMS): Compile ltlgspn-eesrg instead of ltleesrg. (ltleesrg_SOURCES, ltleesrg_LDADD): Replace by... (ltlgspn_eesrg_SOURCES, ltlgspn_eesrg_LDADD, LIBGSPNESRG_LDFLAGS): ... these. * iface/gspn/ltleesrg.cc: Delete. * iface/gspn/ltlgspn.cc [EESRG]: Support EESRG conditionally. Support -e2.
This commit is contained in:
parent
a1f990b125
commit
93f1cc0d47
9 changed files with 271 additions and 109 deletions
|
|
@ -44,7 +44,7 @@ if WITH_GSPN_EESRG
|
|||
gspn_HEADERS += eesrg.hh
|
||||
check_PROGRAMS += \
|
||||
dottygspn-eesrg \
|
||||
ltleesrg
|
||||
ltlgspn-eesrg
|
||||
|
||||
libspotgspneesrg_la_LIBADD = $(top_builddir)/src/libspot.la
|
||||
libspotgspneesrg_la_CPPFLAGS = -DESYMBOLIC $(AM_CPPFLAGS)
|
||||
|
|
@ -69,8 +69,9 @@ ltlgspn_rg_LDADD = libspotgspn.la $(LIBGSPNRG_LDFLAGS)
|
|||
ltlgspn_srg_SOURCES = ltlgspn.cc
|
||||
ltlgspn_srg_LDADD = libspotgspn.la $(LIBGSPNSRG_LDFLAGS)
|
||||
|
||||
ltleesrg_SOURCES = ltleesrg.cc
|
||||
ltleesrg_LDADD = libspotgspneesrg.la $(LIBGSPNESRG_LDFLAGS)
|
||||
ltlgspn_eesrg_SOURCES = ltlgspn.cc
|
||||
ltlgspn_eesrg_LDADD = libspotgspneesrg.la $(LIBGSPNESRG_LDFLAGS)
|
||||
ltlgspn_eesrg_CPPFLAGS = -DEESRG=1 $(AM_CPPFLAGS)
|
||||
|
||||
EXTRA_DIST = \
|
||||
examples/DCSwave/DCSWave.def \
|
||||
|
|
|
|||
|
|
@ -1,98 +0,0 @@
|
|||
// Copyright (C) 2003, 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 "eesrg.hh"
|
||||
#include "tgbaalgos/dotty.hh"
|
||||
#include "tgba/tgbaexplicit.hh"
|
||||
#include "tgbaparse/public.hh"
|
||||
#include "tgbaalgos/ltl2tgba_fm.hh"
|
||||
#include "tgbaalgos/emptinesscheck.hh"
|
||||
#include "ltlparse/public.hh"
|
||||
#include "ltlvisit/destroy.hh"
|
||||
#include "tgba/tgbaproduct.hh"
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
try
|
||||
{
|
||||
spot::gspn_environment env;
|
||||
|
||||
if (argc <= 4)
|
||||
{
|
||||
std::cerr << "usage: " << argv[0]
|
||||
<< " model ltlformula automata props..."
|
||||
<< std::endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
while (argc > 4)
|
||||
env.declare(argv[--argc]);
|
||||
|
||||
spot::ltl::parse_error_list pel;
|
||||
spot::ltl::formula* f = spot::ltl::parse(argv[2], pel, env);
|
||||
if (spot::ltl::format_parse_errors(std::cerr, argv[2], pel))
|
||||
exit(2);
|
||||
|
||||
spot::gspn_eesrg_interface gspn(2, argv);
|
||||
spot::bdd_dict* dict = new spot::bdd_dict();
|
||||
|
||||
spot::tgba_parse_error_list pel1;
|
||||
spot::tgba_explicit* control = spot::tgba_parse(argv[3], pel1,
|
||||
dict, env);
|
||||
if (spot::format_tgba_parse_errors(std::cerr, pel1))
|
||||
return 2;
|
||||
|
||||
spot::tgba* a_f = spot::ltl_to_tgba_fm(f, dict);
|
||||
spot::ltl::destroy(f);
|
||||
|
||||
spot::tgba_product* prod = new spot::tgba_product(control, a_f);
|
||||
|
||||
|
||||
{
|
||||
spot::tgba_gspn_eesrg a(dict, env, prod);
|
||||
|
||||
spot::emptiness_check ec(&a);
|
||||
bool res = ec.check();
|
||||
if (!res)
|
||||
{
|
||||
ec.counter_example();
|
||||
ec.print_result(std::cout, &a);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "empty" << std::endl;
|
||||
}
|
||||
std::cout << std::endl;
|
||||
ec.print_stats(std::cout);
|
||||
if (!res)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
delete prod;
|
||||
delete a_f;
|
||||
delete control;
|
||||
delete dict;
|
||||
}
|
||||
catch (spot::gspn_exeption e)
|
||||
{
|
||||
std::cerr << e << std::endl;
|
||||
throw;
|
||||
}
|
||||
|
|
@ -19,7 +19,15 @@
|
|||
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
// 02111-1307, USA.
|
||||
|
||||
#ifndef EESRG
|
||||
#include "gspn.hh"
|
||||
#define MIN_ARG 3
|
||||
#else
|
||||
#include "eesrg.hh"
|
||||
#define MIN_ARG 4
|
||||
#include "tgba/tgbaexplicit.hh"
|
||||
#include "tgbaparse/public.hh"
|
||||
#endif
|
||||
#include "ltlparse/public.hh"
|
||||
#include "ltlvisit/destroy.hh"
|
||||
#include "tgba/tgbatba.hh"
|
||||
|
|
@ -29,16 +37,22 @@
|
|||
#include "tgbaalgos/magic.hh"
|
||||
#include "tgbaalgos/emptinesscheck.hh"
|
||||
|
||||
|
||||
void
|
||||
syntax(char* prog)
|
||||
{
|
||||
std::cerr << "Usage: "<< prog
|
||||
#ifndef EESRG
|
||||
<< " [OPTIONS...] model formula props..." << std::endl
|
||||
#else
|
||||
<< " [OPTIONS...] model formula automata props..." << std::endl
|
||||
#endif
|
||||
<< std::endl
|
||||
<< " -c compute an example" << std::endl
|
||||
<< " (instead of just checking for emptiness)" << std::endl
|
||||
<< std::endl
|
||||
<< " -e use Couvreur's emptiness-check (default)" << std::endl
|
||||
<< " -e2 use Couvreur's emptiness-check variant" << std::endl
|
||||
<< " -m degeneralize and perform a magic-search" << std::endl
|
||||
<< std::endl
|
||||
<< " -l use Couvreur's LaCIM algorithm for translation (default)"
|
||||
|
|
@ -53,7 +67,7 @@ main(int argc, char **argv)
|
|||
try
|
||||
{
|
||||
int formula_index = 1;
|
||||
enum { Couvreur, Magic } check = Couvreur;
|
||||
enum { Couvreur, Couvreur2, Magic } check = Couvreur;
|
||||
enum { Lacim, Fm } trans = Lacim;
|
||||
bool compute_counter_example = false;
|
||||
bool proj = true;
|
||||
|
|
@ -70,6 +84,10 @@ main(int argc, char **argv)
|
|||
{
|
||||
check = Couvreur;
|
||||
}
|
||||
else if (!strcmp(argv[formula_index], "-e2"))
|
||||
{
|
||||
check = Couvreur2;
|
||||
}
|
||||
else if (!strcmp(argv[formula_index], "-m"))
|
||||
{
|
||||
check = Magic;
|
||||
|
|
@ -92,11 +110,11 @@ main(int argc, char **argv)
|
|||
}
|
||||
++formula_index;
|
||||
}
|
||||
if (argc < formula_index + 3)
|
||||
if (argc < formula_index + MIN_ARG)
|
||||
syntax(argv[0]);
|
||||
|
||||
|
||||
while (argc > formula_index + 2)
|
||||
while (argc >= formula_index + 3)
|
||||
{
|
||||
env.declare(argv[argc - 1]);
|
||||
--argc;
|
||||
|
|
@ -111,9 +129,20 @@ main(int argc, char **argv)
|
|||
exit(2);
|
||||
|
||||
argv[1] = argv[formula_index];
|
||||
spot::gspn_interface gspn(2, argv);
|
||||
spot::bdd_dict* dict = new spot::bdd_dict();
|
||||
|
||||
#if EESRG
|
||||
spot::gspn_eesrg_interface gspn(2, argv);
|
||||
|
||||
spot::tgba_parse_error_list pel1;
|
||||
spot::tgba_explicit* control = spot::tgba_parse(argv[formula_index + 2],
|
||||
pel1, dict, env);
|
||||
if (spot::format_tgba_parse_errors(std::cerr, pel1))
|
||||
return 2;
|
||||
#else
|
||||
spot::gspn_interface gspn(2, argv);
|
||||
#endif
|
||||
|
||||
spot::tgba* a_f = 0;
|
||||
switch (trans)
|
||||
{
|
||||
|
|
@ -126,15 +155,26 @@ main(int argc, char **argv)
|
|||
}
|
||||
spot::ltl::destroy(f);
|
||||
|
||||
#ifndef EESRG
|
||||
spot::tgba* model = new spot::tgba_gspn(dict, env);
|
||||
spot::tgba_product* prod = new spot::tgba_product(model, a_f);
|
||||
#else
|
||||
spot::tgba_product* ca = new spot::tgba_product(control, a_f);
|
||||
spot::tgba* model = new spot::tgba_gspn_eesrg(dict, env, ca);
|
||||
spot::tgba* prod = model;
|
||||
#endif
|
||||
|
||||
switch (check)
|
||||
{
|
||||
case Couvreur:
|
||||
case Couvreur2:
|
||||
{
|
||||
spot::emptiness_check ec(prod);
|
||||
bool res = ec.check();
|
||||
bool res;
|
||||
if (check == Couvreur)
|
||||
res = ec.check();
|
||||
else
|
||||
res = ec.check2();
|
||||
if (!res)
|
||||
{
|
||||
if (compute_counter_example)
|
||||
|
|
@ -177,8 +217,13 @@ main(int argc, char **argv)
|
|||
delete d;
|
||||
}
|
||||
}
|
||||
#ifndef EESRG
|
||||
delete prod;
|
||||
delete model;
|
||||
#else
|
||||
delete model;
|
||||
delete control;
|
||||
#endif
|
||||
delete a_f;
|
||||
delete dict;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue