save: remove

Get rid of the output in Spot's format.

This finally fixes #1.

* src/tgbaalgos/save.cc, src/tgbaalgos/save.hh: Delete.
* src/tgbaalgos/Makefile.am: Adjust.
* src/ltlvisit/contain.cc: Remove useless includes.
* src/bin/dstar2tgba.cc, src/bin/common_aoutput.cc,
src/bin/common_aoutput.hh: Remove the "Spot" output.
* doc/org/dstar2tgba.org, doc/org/ioltl.org,
doc/org/ltl2tgba.org, doc/org/oaut.org: Update doc.
* NEWS: Mention that Spot i/o is gone.
* src/tgbatest/randtgba.cc: Output in HOA.
* src/tgbatest/randtgba.test: Use randaut instead of
randtgba.
* wrap/python/spot.i: Do not provide binding for save.hh
This commit is contained in:
Alexandre Duret-Lutz 2015-01-31 21:13:44 +01:00
parent a246c3b8ba
commit dbd824c539
15 changed files with 35 additions and 177 deletions

View file

@ -31,7 +31,6 @@
#include "tgbaalgos/lbtt.hh"
#include "tgbaalgos/hoa.hh"
#include "tgbaalgos/neverclaim.hh"
#include "tgbaalgos/save.hh"
automaton_format_t automaton_format = Dot;
static const char* opt_dot = nullptr;
@ -42,9 +41,8 @@ static const char* stats = "";
#define OPT_DOT 1
#define OPT_LBTT 2
#define OPT_SPOT 3
#define OPT_STATS 4
#define OPT_NAME 5
#define OPT_STATS 3
#define OPT_NAME 4
static const argp_option options[] =
{
@ -68,7 +66,6 @@ static const argp_option options[] =
{ "spin", 's', "6|c", OPTION_ARG_OPTIONAL, "Spin neverclaim (implies --ba)."
" Add letters to select (6) Spin's 6.2.4 style, (c) comments on states",
0 },
{ "spot", OPT_SPOT, 0, 0, "SPOT's format", 0 },
{ "utf8", '8', 0, 0, "enable UTF-8 characters in output "
"(ignored with --lbtt or --spin)", 0 },
{ "stats", OPT_STATS, "FORMAT", 0,
@ -188,9 +185,6 @@ int parse_opt_aoutput(int key, char* arg, struct argp_state*)
case OPT_NAME:
opt_name = arg;
break;
case OPT_SPOT:
automaton_format = Spot;
break;
case OPT_STATS:
if (!*arg)
error(2, 0, "empty format string for --stats");
@ -248,9 +242,6 @@ automaton_printer::print(const spot::tgba_digraph_ptr& aut,
case Hoa:
spot::hoa_reachable(std::cout, aut, hoa_opt) << '\n';
break;
case Spot:
spot::tgba_save_reachable(std::cout, aut);
break;
case Spin:
spot::never_claim_reachable(std::cout, aut, opt_never);
break;

View file

@ -40,7 +40,6 @@ enum automaton_format_t {
Lbtt,
Lbtt_t,
Spin,
Spot,
Stats,
Hoa,
Quiet,

View file

@ -34,7 +34,6 @@
#include "tgbaalgos/lbtt.hh"
#include "tgbaalgos/hoa.hh"
#include "tgbaalgos/neverclaim.hh"
#include "tgbaalgos/save.hh"
#include "tgbaalgos/stats.hh"
#include "tgba/bddprint.hh"
#include "misc/optionmap.hh"
@ -52,9 +51,8 @@ will be output.";
#define OPT_TGBA 1
#define OPT_DOT 2
#define OPT_LBTT 3
#define OPT_SPOT 4
#define OPT_STATS 5
#define OPT_NAME 6
#define OPT_STATS 4
#define OPT_NAME 5
static const argp_option options[] =
{
@ -88,7 +86,6 @@ static const argp_option options[] =
{ "spin", 's', "6|c", OPTION_ARG_OPTIONAL, "Spin neverclaim (implies --ba)."
" Add letters to select (6) Spin's 6.2.4 style, (c) comments on states",
0 },
{ "spot", OPT_SPOT, 0, 0, "SPOT's format", 0 },
{ "utf8", '8', 0, 0, "enable UTF-8 characters in output "
"(ignored with --lbtt or --spin)", 0 },
{ "stats", OPT_STATS, "FORMAT", 0,
@ -134,7 +131,7 @@ static const struct argp_child children[] =
{ 0, 0, 0, 0 }
};
enum output_format { Dot, Lbtt, Lbtt_t, Spin, Spot, Stats, Hoa };
enum output_format { Dot, Lbtt, Lbtt_t, Spin, Stats, Hoa };
static output_format format = Dot;
static const char* opt_dot = nullptr;
static const char* stats = "";
@ -199,9 +196,6 @@ parse_opt(int key, char* arg, struct argp_state*)
case OPT_NAME:
opt_name = arg;
break;
case OPT_SPOT:
format = Spot;
break;
case OPT_STATS:
if (!*arg)
error(2, 0, "empty format string for --stats");
@ -364,9 +358,6 @@ namespace
case Hoa:
spot::hoa_reachable(std::cout, aut, hoa_opt) << '\n';
break;
case Spot:
spot::tgba_save_reachable(std::cout, aut);
break;
case Spin:
spot::never_claim_reachable(std::cout, aut, opt_never);
break;

View file

@ -28,8 +28,6 @@
#include "ltlast/multop.hh"
#include "ltlast/constant.hh"
#include "tgbaalgos/product.hh"
#include "tgbaalgos/gtec/gtec.hh"
#include "tgbaalgos/save.hh"
namespace spot
{

View file

@ -64,7 +64,6 @@ tgbaalgos_HEADERS = \
relabel.hh \
replayrun.hh \
safety.hh \
save.hh \
sccfilter.hh \
scc.hh \
sccinfo.hh \
@ -116,7 +115,6 @@ libtgbaalgos_la_SOURCES = \
replayrun.cc \
relabel.cc \
safety.cc \
save.cc \
scc.cc \
sccinfo.cc \
sccfilter.cc \

View file

@ -1,86 +0,0 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2011, 2012, 2014 Laboratoire de Recherche et
// Développement de l'Epita (LRDE)
// Copyright (C) 2003, 2004, 2005 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 3 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 this program. If not, see <http://www.gnu.org/licenses/>.
#include <ostream>
#include "save.hh"
#include "tgba/bddprint.hh"
#include "ltlvisit/tostring.hh"
#include "ltlast/atomic_prop.hh"
#include "reachiter.hh"
#include "misc/escape.hh"
namespace spot
{
namespace
{
class save_bfs: public tgba_reachable_iterator_breadth_first
{
public:
save_bfs(const const_tgba_ptr& a, std::ostream& os)
: tgba_reachable_iterator_breadth_first(a), os_(os)
{
}
void
start()
{
os_ << "acc = ";
aut_->acc().format_quoted(os_, aut_->acc().all_sets())
<< ";\n";
}
void
process_state(const state* s, int, tgba_succ_iterator* si)
{
const bdd_dict_ptr d = aut_->get_dict();
std::string cur = escape_str(aut_->format_state(s));
if (si->first())
do
{
state* dest = si->current_state();
os_ << '"' << cur << "\", \"";
escape_str(os_, aut_->format_state(dest));
os_ << "\", \"";
escape_str(os_, bdd_format_formula(d, si->current_condition()));
os_ << "\",";
if (si->current_acceptance_conditions())
aut_->acc().format_quoted(os_ << ' ',
si->current_acceptance_conditions());
os_ << ";\n";
dest->destroy();
}
while (si->next());
}
private:
std::ostream& os_;
};
}
std::ostream&
tgba_save_reachable(std::ostream& os, const_tgba_ptr g)
{
save_bfs b(g, os);
b.run();
return os;
}
}

View file

@ -1,37 +0,0 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2013 Laboratoire de Recherche et Developpement
// de l'Epita (LRDE).
// 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 3 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 this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef SPOT_TGBAALGOS_SAVE_HH
# define SPOT_TGBAALGOS_SAVE_HH
#include "tgba/tgba.hh"
#include <iosfwd>
namespace spot
{
/// \ingroup tgba_io
/// \brief Save reachable states in text format.
SPOT_API std::ostream&
tgba_save_reachable(std::ostream& os, const_tgba_ptr g);
}
#endif // SPOT_TGBAALGOS_SAVE_HH

View file

@ -37,7 +37,7 @@
#include "ltlvisit/length.hh"
#include "ltlvisit/simplify.hh"
#include "tgbaalgos/randomgraph.hh"
#include "tgbaalgos/save.hh"
#include "tgbaalgos/hoa.hh"
#include "tgbaalgos/stats.hh"
#include "ltlenv/defaultenv.hh"
#include "tgbaalgos/dotty.hh"
@ -924,7 +924,7 @@ main(int argc, char** argv)
if (!opt_ec)
{
if (!opt_0 && !opt_dot)
tgba_save_reachable(std::cout, a);
hoa_reachable(std::cout, a, nullptr);
}
else
{

View file

@ -1,6 +1,6 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2010, 2014 Laboratoire de Recherche et Development de
# Copyright (C) 2010, 2014, 2015 Laboratoire de Recherche et Development de
# l'EPITA.
#
# This file is part of Spot, a model checking library.
@ -23,12 +23,11 @@
set -e
for n in 10 20 30 40 50 60 70 80 90 100 200 500 1000; do
# Make sure graph generated by randtgba have successors for each
# Make sure graph generated by randaut have successors for each
# of their $n nodes.
r=`../randtgba -n $n a b c | sed -n 's/^"\([0-9]*\)".*/\1/p' |
sort -u | wc -l`
if test "$r" -eq "$n"; then :; else
echo "test failed for n=$n"
exit 1
fi
../../bin/randaut -S$n 3 -Hl |
sed 's/.*--BODY--//;s/State:/\n&/g;s/--END--//' > out
grep -q 'State: [0-9][0-9]* .*$' out
grep -q 'State: [0-9]* *$' out && exit 1
done
true