Using double borders for acceptance states in SBAs.
* src/tgbaalgos/dotty.hh (dotty_reachable): Take a new assume_sba argument. * src/tgbaalgos/dotty.cc (dotty_bfs): Take a new mark_accepting_states arguments. (dotty_bfs::process_state): Check if a state is accepting using the state_is_accepting() method for tgba_sba_proxies, or by looking at the first outgoing transition of the state. Pass the result to the dectorator. (dotty_reachable): Adjust function. * src/tgbaalgos/dottydec.hh, src/tgbaalgos/dottydec.cc, src/tgbaalgos/rundotdec.hh, src/tgbaalgos/rundotdec.cc (state_decl): Add an "accepting" argument, and use it to decorate accepting states with a double border. * src/tgbatest/ltl2tgba.cc: Keep track of whether the output is an SBA or not, so that we can tell it to dotty(). * wrap/python/ajax/spot.in: Likewise. * wrap/python/cgi-bin/ltl2tgba.in: Likewise.
This commit is contained in:
parent
2c5bae3d37
commit
e1ef47d975
10 changed files with 151 additions and 47 deletions
22
ChangeLog
22
ChangeLog
|
|
@ -1,3 +1,25 @@
|
||||||
|
2011-03-05 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
||||||
|
|
||||||
|
Using double borders for acceptance states in SBAs.
|
||||||
|
|
||||||
|
* src/tgbaalgos/dotty.hh (dotty_reachable): Take a new
|
||||||
|
assume_sba argument.
|
||||||
|
* src/tgbaalgos/dotty.cc (dotty_bfs): Take a new
|
||||||
|
mark_accepting_states arguments.
|
||||||
|
(dotty_bfs::process_state): Check if a state is accepting using
|
||||||
|
the state_is_accepting() method for tgba_sba_proxies, or by
|
||||||
|
looking at the first outgoing transition of the state. Pass
|
||||||
|
the result to the dectorator.
|
||||||
|
(dotty_reachable): Adjust function.
|
||||||
|
* src/tgbaalgos/dottydec.hh, src/tgbaalgos/dottydec.cc,
|
||||||
|
src/tgbaalgos/rundotdec.hh, src/tgbaalgos/rundotdec.cc
|
||||||
|
(state_decl): Add an "accepting" argument, and use it to
|
||||||
|
decorate accepting states with a double border.
|
||||||
|
* src/tgbatest/ltl2tgba.cc: Keep track of whether the output
|
||||||
|
is an SBA or not, so that we can tell it to dotty().
|
||||||
|
* wrap/python/ajax/spot.in: Likewise.
|
||||||
|
* wrap/python/cgi-bin/ltl2tgba.in: Likewise.
|
||||||
|
|
||||||
2011-03-05 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
2011-03-05 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
||||||
|
|
||||||
* src/ltltest/genltl.cc (GF_n): Really use "op".
|
* src/ltltest/genltl.cc (GF_n): Really use "op".
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
// Copyright (C) 2011 Laboratoire de Recherche et Developpement de
|
||||||
|
// l'Epita (LRDE).
|
||||||
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||||
// et Marie Curie.
|
// et Marie Curie.
|
||||||
|
|
@ -25,6 +27,7 @@
|
||||||
#include "tgba/bddprint.hh"
|
#include "tgba/bddprint.hh"
|
||||||
#include "reachiter.hh"
|
#include "reachiter.hh"
|
||||||
#include "misc/escape.hh"
|
#include "misc/escape.hh"
|
||||||
|
#include "tgba/tgbatba.hh"
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
|
|
@ -33,8 +36,11 @@ namespace spot
|
||||||
class dotty_bfs : public tgba_reachable_iterator_breadth_first
|
class dotty_bfs : public tgba_reachable_iterator_breadth_first
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
dotty_bfs(std::ostream& os, const tgba* a, dotty_decorator* dd)
|
dotty_bfs(std::ostream& os, const tgba* a, bool mark_accepting_states,
|
||||||
: tgba_reachable_iterator_breadth_first(a), os_(os), dd_(dd)
|
dotty_decorator* dd)
|
||||||
|
: tgba_reachable_iterator_breadth_first(a), os_(os),
|
||||||
|
mark_accepting_states_(mark_accepting_states), dd_(dd),
|
||||||
|
sba_(dynamic_cast<const tgba_sba_proxy*>(a))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -55,9 +61,31 @@ namespace spot
|
||||||
void
|
void
|
||||||
process_state(const state* s, int n, tgba_succ_iterator* si)
|
process_state(const state* s, int n, tgba_succ_iterator* si)
|
||||||
{
|
{
|
||||||
|
bool accepting;
|
||||||
|
|
||||||
|
if (mark_accepting_states_)
|
||||||
|
{
|
||||||
|
if (sba_)
|
||||||
|
{
|
||||||
|
accepting = sba_->state_is_accepting(s);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
si->first();
|
||||||
|
accepting = ((!si->done())
|
||||||
|
&& (si->current_acceptance_conditions() ==
|
||||||
|
automata_->all_acceptance_conditions()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
accepting = false;
|
||||||
|
}
|
||||||
|
|
||||||
os_ << " " << n << " "
|
os_ << " " << n << " "
|
||||||
<< dd_->state_decl(automata_, s, n, si,
|
<< dd_->state_decl(automata_, s, n, si,
|
||||||
escape_str(automata_->format_state(s)))
|
escape_str(automata_->format_state(s)),
|
||||||
|
accepting)
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -80,14 +108,17 @@ namespace spot
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::ostream& os_;
|
std::ostream& os_;
|
||||||
|
bool mark_accepting_states_;
|
||||||
dotty_decorator* dd_;
|
dotty_decorator* dd_;
|
||||||
|
const tgba_sba_proxy* sba_;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream&
|
std::ostream&
|
||||||
dotty_reachable(std::ostream& os, const tgba* g, dotty_decorator* dd)
|
dotty_reachable(std::ostream& os, const tgba* g,
|
||||||
|
bool assume_sba, dotty_decorator* dd)
|
||||||
{
|
{
|
||||||
dotty_bfs d(os, g, dd);
|
dotty_bfs d(os, g, assume_sba, dd);
|
||||||
d.run();
|
d.run();
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
// Copyright (C) 2003, 2004, 2011 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||||
// et Marie Curie.
|
// et Marie Curie.
|
||||||
//
|
//
|
||||||
|
|
@ -31,12 +31,17 @@ namespace spot
|
||||||
|
|
||||||
/// \brief Print reachable states in dot format.
|
/// \brief Print reachable states in dot format.
|
||||||
/// \ingroup tgba_io
|
/// \ingroup tgba_io
|
||||||
|
///
|
||||||
|
/// If assume_sba is set, this assumes that the automaton
|
||||||
|
/// is an SBA and use double elipse to mark accepting states.
|
||||||
|
///
|
||||||
/// The \a dd argument allows to customize the output in various
|
/// The \a dd argument allows to customize the output in various
|
||||||
/// ways. See \ref tgba_dotty "this page" for a list of available
|
/// ways. See \ref tgba_dotty "this page" for a list of available
|
||||||
/// decorators.
|
/// decorators.
|
||||||
std::ostream&
|
std::ostream&
|
||||||
dotty_reachable(std::ostream& os,
|
dotty_reachable(std::ostream& os,
|
||||||
const tgba* g,
|
const tgba* g,
|
||||||
|
bool assume_sba = false,
|
||||||
dotty_decorator* dd = dotty_decorator::instance());
|
dotty_decorator* dd = dotty_decorator::instance());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
// Copyright (C) 2011 Laboratoire de Recherche et Developpement de
|
||||||
|
// l'Epita (LRDE).
|
||||||
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||||
// et Marie Curie.
|
// et Marie Curie.
|
||||||
|
|
@ -34,9 +36,13 @@ namespace spot
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
dotty_decorator::state_decl(const tgba*, const state*, int,
|
dotty_decorator::state_decl(const tgba*, const state*, int,
|
||||||
tgba_succ_iterator*, const std::string& label)
|
tgba_succ_iterator*, const std::string& label,
|
||||||
|
bool accepting)
|
||||||
{
|
{
|
||||||
return "[label=\"" + label + "\"]";
|
if (accepting)
|
||||||
|
return "[label=\"" + label + "\", peripheries=2]";
|
||||||
|
else
|
||||||
|
return "[label=\"" + label + "\"]";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
// Copyright (C) 2004, 2011 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||||
// et Marie Curie.
|
// et Marie Curie.
|
||||||
//
|
//
|
||||||
|
|
@ -53,9 +53,12 @@ namespace spot
|
||||||
/// \param si an iterator over the successors of this state (owned by the
|
/// \param si an iterator over the successors of this state (owned by the
|
||||||
/// caller, but can be freely iterated)
|
/// caller, but can be freely iterated)
|
||||||
/// \param label the computed name of this state
|
/// \param label the computed name of this state
|
||||||
|
/// \param accepting whether the state is accepting (it makes sense only
|
||||||
|
/// for state-acceptance automata)
|
||||||
virtual std::string state_decl(const tgba* a, const state* s, int n,
|
virtual std::string state_decl(const tgba* a, const state* s, int n,
|
||||||
tgba_succ_iterator* si,
|
tgba_succ_iterator* si,
|
||||||
const std::string& label);
|
const std::string& label,
|
||||||
|
bool accepting);
|
||||||
|
|
||||||
/// \brief Compute the style of a link.
|
/// \brief Compute the style of a link.
|
||||||
///
|
///
|
||||||
|
|
@ -86,6 +89,7 @@ namespace spot
|
||||||
protected:
|
protected:
|
||||||
dotty_decorator();
|
dotty_decorator();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // SPOT_TGBAALGOS_DOTTYDEC_HH
|
#endif // SPOT_TGBAALGOS_DOTTYDEC_HH
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
// Copyright (C) 2004, 2011 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||||
// et Marie Curie.
|
// et Marie Curie.
|
||||||
//
|
//
|
||||||
|
|
@ -45,11 +45,13 @@ namespace spot
|
||||||
std::string
|
std::string
|
||||||
tgba_run_dotty_decorator::state_decl(const tgba*, const state* s, int,
|
tgba_run_dotty_decorator::state_decl(const tgba*, const state* s, int,
|
||||||
tgba_succ_iterator*,
|
tgba_succ_iterator*,
|
||||||
const std::string& label)
|
const std::string& label,
|
||||||
|
bool accepting)
|
||||||
{
|
{
|
||||||
step_map::const_iterator i = map_.find(s);
|
step_map::const_iterator i = map_.find(s);
|
||||||
|
std::string acc = accepting ? ", peripheries=2" : "";
|
||||||
if (i == map_.end())
|
if (i == map_.end())
|
||||||
return "[label=\"" + label + "\"]";
|
return "[label=\"" + label + acc + "\"]";
|
||||||
|
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
std::string sep = "(";
|
std::string sep = "(";
|
||||||
|
|
@ -74,7 +76,8 @@ namespace spot
|
||||||
assert(in_cycle || in_prefix);
|
assert(in_cycle || in_prefix);
|
||||||
os << ")\\n" << label;
|
os << ")\\n" << label;
|
||||||
std::string color = in_prefix ? (in_cycle ? "violet" : "blue") : "red";
|
std::string color = in_prefix ? (in_cycle ? "violet" : "blue") : "red";
|
||||||
return "[label=\"" + os.str() + "\", style=bold, color=" + color + "]";
|
return "[label=\"" + os.str() + "\", style=bold, color="
|
||||||
|
+ color + acc + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
// Copyright (C) 2011 Laboratoire de Recherche et Developpement de
|
||||||
|
// l'Epita (LRDE).
|
||||||
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||||
// et Marie Curie.
|
// et Marie Curie.
|
||||||
|
|
@ -42,7 +44,8 @@ namespace spot
|
||||||
|
|
||||||
virtual std::string state_decl(const tgba* a, const state* s, int n,
|
virtual std::string state_decl(const tgba* a, const state* s, int n,
|
||||||
tgba_succ_iterator* si,
|
tgba_succ_iterator* si,
|
||||||
const std::string& label);
|
const std::string& label,
|
||||||
|
bool accepting);
|
||||||
virtual std::string link_decl(const tgba* a,
|
virtual std::string link_decl(const tgba* a,
|
||||||
const state* in_s, int in,
|
const state* in_s, int in,
|
||||||
const state* out_s, int out,
|
const state* out_s, int out,
|
||||||
|
|
|
||||||
|
|
@ -336,6 +336,7 @@ main(int argc, char** argv)
|
||||||
spot::bdd_dict* dict = new spot::bdd_dict();
|
spot::bdd_dict* dict = new spot::bdd_dict();
|
||||||
spot::timer_map tm;
|
spot::timer_map tm;
|
||||||
bool use_timer = false;
|
bool use_timer = false;
|
||||||
|
bool assume_sba = false;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
|
@ -924,14 +925,20 @@ main(int argc, char** argv)
|
||||||
&& n_acc > 1
|
&& n_acc > 1
|
||||||
&& echeck_inst->max_acceptance_conditions() < n_acc)
|
&& echeck_inst->max_acceptance_conditions() < n_acc)
|
||||||
degeneralize_opt = DegenTBA;
|
degeneralize_opt = DegenTBA;
|
||||||
|
|
||||||
if (degeneralize_opt == DegenTBA)
|
if (degeneralize_opt == DegenTBA)
|
||||||
a = degeneralized = new spot::tgba_tba_proxy(a);
|
{
|
||||||
|
a = degeneralized = new spot::tgba_tba_proxy(a);
|
||||||
|
}
|
||||||
else if (degeneralize_opt == DegenSBA)
|
else if (degeneralize_opt == DegenSBA)
|
||||||
a = degeneralized = new spot::tgba_sba_proxy(a);
|
{
|
||||||
|
a = degeneralized = new spot::tgba_sba_proxy(a);
|
||||||
|
assume_sba = true;
|
||||||
|
}
|
||||||
else if (labeling_opt == StateLabeled)
|
else if (labeling_opt == StateLabeled)
|
||||||
{
|
{
|
||||||
a = state_labeled = new spot::tgba_sgba_proxy(a);
|
a = state_labeled = new spot::tgba_sgba_proxy(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
const spot::tgba* minimized = 0;
|
const spot::tgba* minimized = 0;
|
||||||
if (opt_minimize)
|
if (opt_minimize)
|
||||||
|
|
@ -957,6 +964,7 @@ main(int argc, char** argv)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
a = minimized;
|
a = minimized;
|
||||||
|
assume_sba = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -965,6 +973,9 @@ main(int argc, char** argv)
|
||||||
tm.start("Monitor minimization");
|
tm.start("Monitor minimization");
|
||||||
a = minimized = minimize_monitor(a);
|
a = minimized = minimize_monitor(a);
|
||||||
tm.stop("Monitor minimization");
|
tm.stop("Monitor minimization");
|
||||||
|
assume_sba = false; // All states are accepting, so double
|
||||||
|
// circles in the dot output are
|
||||||
|
// pointless.
|
||||||
}
|
}
|
||||||
|
|
||||||
spot::tgba_reduc* aut_red = 0;
|
spot::tgba_reduc* aut_red = 0;
|
||||||
|
|
@ -1045,6 +1056,8 @@ main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
a = product = product_to_free = new spot::tgba_product(system, a);
|
a = product = product_to_free = new spot::tgba_product(system, a);
|
||||||
|
|
||||||
|
assume_sba = false;
|
||||||
|
|
||||||
unsigned int n_acc = a->number_of_acceptance_conditions();
|
unsigned int n_acc = a->number_of_acceptance_conditions();
|
||||||
if (echeck_inst
|
if (echeck_inst
|
||||||
&& degeneralize_opt == NoDegen
|
&& degeneralize_opt == NoDegen
|
||||||
|
|
@ -1052,11 +1065,16 @@ main(int argc, char** argv)
|
||||||
&& echeck_inst->max_acceptance_conditions() < n_acc)
|
&& echeck_inst->max_acceptance_conditions() < n_acc)
|
||||||
degeneralize_opt = DegenTBA;
|
degeneralize_opt = DegenTBA;
|
||||||
if (degeneralize_opt == DegenTBA)
|
if (degeneralize_opt == DegenTBA)
|
||||||
a = product = product_degeneralized =
|
{
|
||||||
new spot::tgba_tba_proxy(product);
|
a = product = product_degeneralized =
|
||||||
|
new spot::tgba_tba_proxy(product);
|
||||||
|
}
|
||||||
else if (degeneralize_opt == DegenSBA)
|
else if (degeneralize_opt == DegenSBA)
|
||||||
a = product = product_degeneralized =
|
{
|
||||||
new spot::tgba_sba_proxy(product);
|
a = product = product_degeneralized =
|
||||||
|
new spot::tgba_sba_proxy(product);
|
||||||
|
assume_sba = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (echeck_inst
|
if (echeck_inst
|
||||||
|
|
@ -1088,7 +1106,7 @@ main(int argc, char** argv)
|
||||||
switch (output)
|
switch (output)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
spot::dotty_reachable(std::cout, a);
|
spot::dotty_reachable(std::cout, a, assume_sba);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (concrete)
|
if (concrete)
|
||||||
|
|
@ -1296,7 +1314,8 @@ main(int argc, char** argv)
|
||||||
if (graph_run_opt)
|
if (graph_run_opt)
|
||||||
{
|
{
|
||||||
spot::tgba_run_dotty_decorator deco(run);
|
spot::tgba_run_dotty_decorator deco(run);
|
||||||
spot::dotty_reachable(std::cout, a, &deco);
|
spot::dotty_reachable(std::cout, a,
|
||||||
|
assume_sba, &deco);
|
||||||
}
|
}
|
||||||
else if (graph_run_tgba_opt)
|
else if (graph_run_tgba_opt)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -124,12 +124,12 @@ def render_dot(basename):
|
||||||
print '</div>'
|
print '</div>'
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
def render_automaton(basename, automata, dont_run_dot, deco = False):
|
def render_automaton(basename, automata, dont_run_dot, issba, deco = False):
|
||||||
outfile = spot.ofstream(basename + '.txt')
|
outfile = spot.ofstream(basename + '.txt')
|
||||||
if not deco:
|
if not deco:
|
||||||
spot.dotty_reachable(outfile, automata)
|
spot.dotty_reachable(outfile, automata, issba)
|
||||||
else:
|
else:
|
||||||
spot.dotty_reachable(outfile, automata, deco)
|
spot.dotty_reachable(outfile, automata, issba, deco)
|
||||||
del outfile
|
del outfile
|
||||||
if dont_run_dot:
|
if dont_run_dot:
|
||||||
print ('<p>' + dont_run_dot + ''' to be rendered on-line. However
|
print ('<p>' + dont_run_dot + ''' to be rendered on-line. However
|
||||||
|
|
@ -268,6 +268,9 @@ elif translator == 'ta':
|
||||||
refined_rules = True
|
refined_rules = True
|
||||||
automaton = spot.ltl_to_taa(f, dict, refined_rules)
|
automaton = spot.ltl_to_taa(f, dict, refined_rules)
|
||||||
|
|
||||||
|
# Should it be displayed as a SBA?
|
||||||
|
issba = False
|
||||||
|
|
||||||
# Monitor output
|
# Monitor output
|
||||||
if output_type == 'm':
|
if output_type == 'm':
|
||||||
automaton = spot.scc_filter(automaton)
|
automaton = spot.scc_filter(automaton)
|
||||||
|
|
@ -275,7 +278,7 @@ if output_type == 'm':
|
||||||
print '<div class="automata-stats">'
|
print '<div class="automata-stats">'
|
||||||
dont_run_dot = print_stats(automaton)
|
dont_run_dot = print_stats(automaton)
|
||||||
print '</div>'
|
print '</div>'
|
||||||
render_automaton(imgprefix + '-a', automaton, dont_run_dot)
|
render_automaton(imgprefix + '-a', automaton, dont_run_dot, issba)
|
||||||
automaton = 0
|
automaton = 0
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
|
|
@ -317,9 +320,11 @@ if wdba_minimize:
|
||||||
automaton = minimized
|
automaton = minimized
|
||||||
minimized = 0
|
minimized = 0
|
||||||
degen = False # No need to degeneralize anymore
|
degen = False # No need to degeneralize anymore
|
||||||
|
issba = True
|
||||||
|
|
||||||
if degen or neverclaim:
|
if degen or neverclaim:
|
||||||
degen = spot.tgba_sba_proxy(automaton)
|
degen = spot.tgba_sba_proxy(automaton)
|
||||||
|
issba = True
|
||||||
else:
|
else:
|
||||||
degen = automaton
|
degen = automaton
|
||||||
|
|
||||||
|
|
@ -332,7 +337,7 @@ if output_type == 'a':
|
||||||
del s
|
del s
|
||||||
else: # 't' or 's'
|
else: # 't' or 's'
|
||||||
dont_run_dot = print_stats(degen)
|
dont_run_dot = print_stats(degen)
|
||||||
render_automaton(imgprefix + '-a', degen, dont_run_dot)
|
render_automaton(imgprefix + '-a', degen, dont_run_dot, issba)
|
||||||
degen = 0
|
degen = 0
|
||||||
automaton = 0
|
automaton = 0
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
@ -391,7 +396,8 @@ if output_type == 'r':
|
||||||
if draw_acc_run:
|
if draw_acc_run:
|
||||||
deco = spot.tgba_run_dotty_decorator(ec_run)
|
deco = spot.tgba_run_dotty_decorator(ec_run)
|
||||||
dont_run_dot = print_stats(ec_a)
|
dont_run_dot = print_stats(ec_a)
|
||||||
render_automaton(imgprefix + '-e', ec_a, dont_run_dot, deco)
|
render_automaton(imgprefix + '-e', ec_a, dont_run_dot,
|
||||||
|
issba, deco)
|
||||||
del deco
|
del deco
|
||||||
del ec_run
|
del ec_run
|
||||||
del ec_res
|
del ec_res
|
||||||
|
|
|
||||||
|
|
@ -205,12 +205,12 @@ def render_dot(basename):
|
||||||
+ '.txt">dot source</a>)')
|
+ '.txt">dot source</a>)')
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
def render_automaton(basename, automata, dont_run_dot, deco = False):
|
def render_automaton(basename, automata, dont_run_dot, issba, deco = False):
|
||||||
outfile = spot.ofstream(basename + '.txt')
|
outfile = spot.ofstream(basename + '.txt')
|
||||||
if not deco:
|
if not deco:
|
||||||
spot.dotty_reachable(outfile, automata)
|
spot.dotty_reachable(outfile, automata, issba)
|
||||||
else:
|
else:
|
||||||
spot.dotty_reachable(outfile, automata, deco)
|
spot.dotty_reachable(outfile, automata, issba, deco)
|
||||||
del outfile
|
del outfile
|
||||||
if dont_run_dot:
|
if dont_run_dot:
|
||||||
print ('<p>' + dont_run_dot + ''' to be rendered on-line. However
|
print ('<p>' + dont_run_dot + ''' to be rendered on-line. However
|
||||||
|
|
@ -574,6 +574,8 @@ elif trans_fm:
|
||||||
elif trans_taa:
|
elif trans_taa:
|
||||||
automaton = spot.ltl_to_taa(f, dict, refined_rules)
|
automaton = spot.ltl_to_taa(f, dict, refined_rules)
|
||||||
|
|
||||||
|
issba = False
|
||||||
|
|
||||||
if reduce_dmonitor:
|
if reduce_dmonitor:
|
||||||
automaton = spot.minimize_monitor(automaton)
|
automaton = spot.minimize_monitor(automaton)
|
||||||
elif reduce_wdba:
|
elif reduce_wdba:
|
||||||
|
|
@ -581,6 +583,7 @@ elif reduce_wdba:
|
||||||
if minimized:
|
if minimized:
|
||||||
automaton = minimized
|
automaton = minimized
|
||||||
minimized = 0
|
minimized = 0
|
||||||
|
issba = True
|
||||||
elif reduce_scc:
|
elif reduce_scc:
|
||||||
# Do not suppress all useless acceptance conditions if
|
# Do not suppress all useless acceptance conditions if
|
||||||
# degeneralization is requested: keeping those that lead to
|
# degeneralization is requested: keeping those that lead to
|
||||||
|
|
@ -594,14 +597,14 @@ sys.stdout.flush()
|
||||||
dont_run_dot = print_stats(automaton)
|
dont_run_dot = print_stats(automaton)
|
||||||
|
|
||||||
if show_automaton_png:
|
if show_automaton_png:
|
||||||
render_automaton(imgprefix + '-a', automaton, dont_run_dot)
|
render_automaton(imgprefix + '-a', automaton, dont_run_dot, issba)
|
||||||
|
|
||||||
if show_degen_png or show_never_claim:
|
if show_degen_png or show_never_claim:
|
||||||
print '<H3>Degeneralized automaton</H3>'
|
print '<H3>Degeneralized automaton</H3>'
|
||||||
degen = spot.tgba_sba_proxy(automaton)
|
degen = spot.tgba_sba_proxy(automaton)
|
||||||
dont_run_dot = print_stats(degen)
|
dont_run_dot = print_stats(degen)
|
||||||
if show_degen_png:
|
if show_degen_png:
|
||||||
render_automaton(imgprefix + '-d', degen, dont_run_dot)
|
render_automaton(imgprefix + '-d', degen, dont_run_dot, True)
|
||||||
else:
|
else:
|
||||||
degen = 0
|
degen = 0
|
||||||
|
|
||||||
|
|
@ -627,7 +630,7 @@ if (type(automaton) == spot.tgba_bdd_concrete
|
||||||
print '<H3>Transition relation</H3>'
|
print '<H3>Transition relation</H3>'
|
||||||
if show_relation_set:
|
if show_relation_set:
|
||||||
escaped_print_set(automaton.get_dict(),
|
escaped_print_set(automaton.get_dict(),
|
||||||
automaton.get_core_data().relation)
|
automaton.get_core_data().relation)
|
||||||
if show_relation_png:
|
if show_relation_png:
|
||||||
render_bdd(imgprefix + '-b', automaton.get_dict(),
|
render_bdd(imgprefix + '-b', automaton.get_dict(),
|
||||||
automaton.get_core_data().relation)
|
automaton.get_core_data().relation)
|
||||||
|
|
@ -637,7 +640,7 @@ if (type(automaton) == spot.tgba_bdd_concrete
|
||||||
print '<H3>Acceptance relation</H3>'
|
print '<H3>Acceptance relation</H3>'
|
||||||
if show_acceptance_set:
|
if show_acceptance_set:
|
||||||
escaped_print_set(automaton.get_dict(),
|
escaped_print_set(automaton.get_dict(),
|
||||||
automaton.get_core_data().acceptance_conditions)
|
automaton.get_core_data().acceptance_conditions)
|
||||||
if show_acceptance_png:
|
if show_acceptance_png:
|
||||||
render_bdd(imgprefix + '-c', automaton.get_dict(),
|
render_bdd(imgprefix + '-c', automaton.get_dict(),
|
||||||
automaton.get_core_data().acceptance_conditions)
|
automaton.get_core_data().acceptance_conditions)
|
||||||
|
|
@ -681,6 +684,7 @@ if draw_acc_run or print_acc_run:
|
||||||
if degen:
|
if degen:
|
||||||
ec_a = degen
|
ec_a = degen
|
||||||
ec_msg += ' <b>on degeneralized automaton</b>'
|
ec_msg += ' <b>on degeneralized automaton</b>'
|
||||||
|
issba = True
|
||||||
else:
|
else:
|
||||||
print ('<font color="red">Cannot run ' + emptiness_check
|
print ('<font color="red">Cannot run ' + emptiness_check
|
||||||
+ ' on automata with more than ' + str(n_max)
|
+ ' on automata with more than ' + str(n_max)
|
||||||
|
|
@ -712,7 +716,8 @@ if draw_acc_run or print_acc_run:
|
||||||
if draw_acc_run:
|
if draw_acc_run:
|
||||||
deco = spot.tgba_run_dotty_decorator(ec_run)
|
deco = spot.tgba_run_dotty_decorator(ec_run)
|
||||||
dont_run_dot = print_stats(ec_a)
|
dont_run_dot = print_stats(ec_a)
|
||||||
render_automaton(imgprefix + '-e', ec_a, dont_run_dot, deco)
|
render_automaton(imgprefix + '-e', ec_a, dont_run_dot,
|
||||||
|
issba, deco)
|
||||||
del deco
|
del deco
|
||||||
del ec_run
|
del ec_run
|
||||||
del ec_res
|
del ec_res
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue