rename tgba_digraph as twa_graph
Automatic mass renaming. * src/bin/autfilt.cc, src/bin/common_aoutput.cc, src/bin/common_aoutput.hh, src/bin/common_conv.cc, src/bin/common_conv.hh, src/bin/common_output.hh, src/bin/dstar2tgba.cc, src/bin/ltlcross.cc, src/bin/ltldo.cc, src/bin/randaut.cc, src/dstarparse/dra2ba.cc, src/dstarparse/dstar2tgba.cc, src/dstarparse/dstarparse.yy, src/dstarparse/nra2nba.cc, src/dstarparse/nsa2tgba.cc, src/dstarparse/public.hh, src/graphtest/tgbagraph.cc, src/hoaparse/hoaparse.yy, src/hoaparse/public.hh, src/ltlvisit/contain.hh, src/ltlvisit/exclusive.cc, src/ltlvisit/exclusive.hh, src/priv/accmap.hh, src/taalgos/minimize.cc, src/tgba/fwd.hh, src/tgba/tgba.cc, src/tgba/tgbagraph.cc, src/tgba/tgbagraph.hh, src/tgba/tgbasafracomplement.cc, src/tgba/tgbasafracomplement.hh, src/tgbaalgos/are_isomorphic.cc, src/tgbaalgos/are_isomorphic.hh, src/tgbaalgos/canonicalize.cc, src/tgbaalgos/canonicalize.hh, src/tgbaalgos/cleanacc.cc, src/tgbaalgos/cleanacc.hh, src/tgbaalgos/complete.cc, src/tgbaalgos/complete.hh, src/tgbaalgos/compsusp.cc, src/tgbaalgos/compsusp.hh, src/tgbaalgos/cycles.hh, src/tgbaalgos/degen.cc, src/tgbaalgos/degen.hh, src/tgbaalgos/dotty.cc, src/tgbaalgos/dtbasat.cc, src/tgbaalgos/dtbasat.hh, src/tgbaalgos/dtgbacomp.cc, src/tgbaalgos/dtgbacomp.hh, src/tgbaalgos/dtgbasat.cc, src/tgbaalgos/dtgbasat.hh, src/tgbaalgos/dupexp.cc, src/tgbaalgos/dupexp.hh, src/tgbaalgos/emptiness.cc, src/tgbaalgos/emptiness.hh, src/tgbaalgos/hoa.cc, src/tgbaalgos/isdet.cc, src/tgbaalgos/isdet.hh, src/tgbaalgos/lbtt.cc, src/tgbaalgos/ltl2tgba_fm.cc, src/tgbaalgos/ltl2tgba_fm.hh, src/tgbaalgos/mask.cc, src/tgbaalgos/mask.hh, src/tgbaalgos/minimize.cc, src/tgbaalgos/minimize.hh, src/tgbaalgos/neverclaim.cc, src/tgbaalgos/postproc.cc, src/tgbaalgos/postproc.hh, src/tgbaalgos/powerset.cc, src/tgbaalgos/powerset.hh, src/tgbaalgos/product.cc, src/tgbaalgos/product.hh, src/tgbaalgos/randomgraph.cc, src/tgbaalgos/randomgraph.hh, src/tgbaalgos/randomize.cc, src/tgbaalgos/randomize.hh, src/tgbaalgos/relabel.cc, src/tgbaalgos/relabel.hh, src/tgbaalgos/remfin.cc, src/tgbaalgos/remfin.hh, src/tgbaalgos/remprop.cc, src/tgbaalgos/remprop.hh, src/tgbaalgos/safety.cc, src/tgbaalgos/safety.hh, src/tgbaalgos/sbacc.cc, src/tgbaalgos/sbacc.hh, src/tgbaalgos/sccfilter.cc, src/tgbaalgos/sccfilter.hh, src/tgbaalgos/sccinfo.cc, src/tgbaalgos/sccinfo.hh, src/tgbaalgos/simulation.cc, src/tgbaalgos/simulation.hh, src/tgbaalgos/stats.cc, src/tgbaalgos/stats.hh, src/tgbaalgos/stripacc.cc, src/tgbaalgos/stripacc.hh, src/tgbaalgos/stutter.cc, src/tgbaalgos/stutter.hh, src/tgbaalgos/totgba.cc, src/tgbaalgos/totgba.hh, src/tgbaalgos/translate.cc, src/tgbaalgos/translate.hh, src/tgbatest/checkpsl.cc, src/tgbatest/complementation.cc, src/tgbatest/emptchk.cc, src/tgbatest/ltl2tgba.cc, src/tgbatest/randtgba.cc, wrap/python/spot_impl.i, wrap/python/tests/automata-io.ipynb, wrap/python/tests/automata.ipynb, wrap/python/tests/piperead.ipynb, wrap/python/tests/testingaut.ipynb: Rename tgba_digraph as twa_graph.
This commit is contained in:
parent
c2ae99e779
commit
e0bd0ad4c0
111 changed files with 523 additions and 523 deletions
|
|
@ -208,7 +208,7 @@ static const struct argp_child children[] =
|
||||||
{ 0, 0, 0, 0 }
|
{ 0, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef spot::tgba_digraph::graph_t::trans_storage_t tr_t;
|
typedef spot::twa_graph::graph_t::trans_storage_t tr_t;
|
||||||
typedef std::set<std::vector<tr_t>> unique_aut_t;
|
typedef std::set<std::vector<tr_t>> unique_aut_t;
|
||||||
static long int match_count = 0;
|
static long int match_count = 0;
|
||||||
static spot::option_map extra_options;
|
static spot::option_map extra_options;
|
||||||
|
|
@ -223,9 +223,9 @@ static int opt_seed = 0;
|
||||||
static struct opt_t
|
static struct opt_t
|
||||||
{
|
{
|
||||||
spot::bdd_dict_ptr dict = spot::make_bdd_dict();
|
spot::bdd_dict_ptr dict = spot::make_bdd_dict();
|
||||||
spot::tgba_digraph_ptr product = nullptr;
|
spot::twa_graph_ptr product = nullptr;
|
||||||
spot::tgba_digraph_ptr intersect = nullptr;
|
spot::twa_graph_ptr intersect = nullptr;
|
||||||
spot::tgba_digraph_ptr are_isomorphic = nullptr;
|
spot::twa_graph_ptr are_isomorphic = nullptr;
|
||||||
std::unique_ptr<spot::isomorphism_checker>
|
std::unique_ptr<spot::isomorphism_checker>
|
||||||
isomorphism_checker = nullptr;
|
isomorphism_checker = nullptr;
|
||||||
std::unique_ptr<unique_aut_t> uniq = nullptr;
|
std::unique_ptr<unique_aut_t> uniq = nullptr;
|
||||||
|
|
@ -488,7 +488,7 @@ namespace
|
||||||
// never modify the original automaton (e.g. with
|
// never modify the original automaton (e.g. with
|
||||||
// merge_transitions()) and the statistics about it make sense.
|
// merge_transitions()) and the statistics about it make sense.
|
||||||
auto aut = ((automaton_format == Stats) || opt_name)
|
auto aut = ((automaton_format == Stats) || opt_name)
|
||||||
? spot::make_tgba_digraph(haut->aut, spot::twa::prop_set::all())
|
? spot::make_twa_graph(haut->aut, spot::twa::prop_set::all())
|
||||||
: haut->aut;
|
: haut->aut;
|
||||||
|
|
||||||
// Preprocessing.
|
// Preprocessing.
|
||||||
|
|
@ -576,7 +576,7 @@ namespace
|
||||||
if (opt->uniq)
|
if (opt->uniq)
|
||||||
{
|
{
|
||||||
auto tmp =
|
auto tmp =
|
||||||
spot::canonicalize(make_tgba_digraph(aut,
|
spot::canonicalize(make_twa_graph(aut,
|
||||||
spot::twa::prop_set::all()));
|
spot::twa::prop_set::all()));
|
||||||
if (!opt->uniq->emplace(tmp->transition_vector().begin() + 1,
|
if (!opt->uniq->emplace(tmp->transition_vector().begin() + 1,
|
||||||
tmp->transition_vector().end()).second)
|
tmp->transition_vector().end()).second)
|
||||||
|
|
|
||||||
|
|
@ -231,7 +231,7 @@ automaton_printer::automaton_printer(stat_style input)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
automaton_printer::print(const spot::tgba_digraph_ptr& aut,
|
automaton_printer::print(const spot::twa_graph_ptr& aut,
|
||||||
const spot::ltl::formula* f,
|
const spot::ltl::formula* f,
|
||||||
// Input location for errors and statistics.
|
// Input location for errors and statistics.
|
||||||
const char* filename,
|
const char* filename,
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ public:
|
||||||
/// to be output.
|
/// to be output.
|
||||||
std::ostream&
|
std::ostream&
|
||||||
print(const spot::const_hoa_aut_ptr& haut,
|
print(const spot::const_hoa_aut_ptr& haut,
|
||||||
const spot::const_tgba_digraph_ptr& aut,
|
const spot::const_twa_graph_ptr& aut,
|
||||||
const spot::ltl::formula* f,
|
const spot::ltl::formula* f,
|
||||||
const char* filename, int loc, double run_time)
|
const char* filename, int loc, double run_time)
|
||||||
{
|
{
|
||||||
|
|
@ -225,7 +225,7 @@ public:
|
||||||
automaton_printer(stat_style input = no_input);
|
automaton_printer(stat_style input = no_input);
|
||||||
|
|
||||||
void
|
void
|
||||||
print(const spot::tgba_digraph_ptr& aut,
|
print(const spot::twa_graph_ptr& aut,
|
||||||
const spot::ltl::formula* f = nullptr,
|
const spot::ltl::formula* f = nullptr,
|
||||||
// Input location for errors and statistics.
|
// Input location for errors and statistics.
|
||||||
const char* filename = nullptr,
|
const char* filename = nullptr,
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ to_probability(const char* s)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
spot::tgba_digraph_ptr
|
spot::twa_graph_ptr
|
||||||
read_automaton(const char* filename, spot::bdd_dict_ptr& dict)
|
read_automaton(const char* filename, spot::bdd_dict_ptr& dict)
|
||||||
{
|
{
|
||||||
spot::hoa_parse_error_list pel;
|
spot::hoa_parse_error_list pel;
|
||||||
|
|
|
||||||
|
|
@ -31,5 +31,5 @@ float to_probability(const char* s);
|
||||||
// Parse the comma or space seperate string of numbers.
|
// Parse the comma or space seperate string of numbers.
|
||||||
std::vector<long> to_longs(const char* s);
|
std::vector<long> to_longs(const char* s);
|
||||||
|
|
||||||
spot::tgba_digraph_ptr
|
spot::twa_graph_ptr
|
||||||
read_automaton(const char* filename, spot::bdd_dict_ptr& dict);
|
read_automaton(const char* filename, spot::bdd_dict_ptr& dict);
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ public:
|
||||||
using spot::formater::set_output;
|
using spot::formater::set_output;
|
||||||
|
|
||||||
std::ostream&
|
std::ostream&
|
||||||
print(const spot::const_tgba_digraph_ptr& aut,
|
print(const spot::const_twa_graph_ptr& aut,
|
||||||
const spot::ltl::formula* f = 0,
|
const spot::ltl::formula* f = 0,
|
||||||
double run_time = -1.)
|
double run_time = -1.)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -268,7 +268,7 @@ namespace
|
||||||
/// to be output.
|
/// to be output.
|
||||||
std::ostream&
|
std::ostream&
|
||||||
print(const spot::const_dstar_aut_ptr& daut,
|
print(const spot::const_dstar_aut_ptr& daut,
|
||||||
const spot::const_tgba_digraph_ptr& aut,
|
const spot::const_twa_graph_ptr& aut,
|
||||||
const char* filename, double run_time)
|
const char* filename, double run_time)
|
||||||
{
|
{
|
||||||
filename_ = filename;
|
filename_ = filename;
|
||||||
|
|
|
||||||
|
|
@ -484,7 +484,7 @@ namespace
|
||||||
has_sr = has('D');
|
has_sr = has('D');
|
||||||
}
|
}
|
||||||
|
|
||||||
spot::tgba_digraph_ptr
|
spot::twa_graph_ptr
|
||||||
translate(unsigned int translator_num, char l, statistics_formula* fstats,
|
translate(unsigned int translator_num, char l, statistics_formula* fstats,
|
||||||
bool& problem)
|
bool& problem)
|
||||||
{
|
{
|
||||||
|
|
@ -505,7 +505,7 @@ namespace
|
||||||
|
|
||||||
const char* status_str = 0;
|
const char* status_str = 0;
|
||||||
|
|
||||||
spot::tgba_digraph_ptr res = 0;
|
spot::twa_graph_ptr res = 0;
|
||||||
if (timed_out)
|
if (timed_out)
|
||||||
{
|
{
|
||||||
// This is not considered to be a global error.
|
// This is not considered to be a global error.
|
||||||
|
|
@ -696,8 +696,8 @@ namespace
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
check_empty_prod(const spot::const_tgba_digraph_ptr& aut_i,
|
check_empty_prod(const spot::const_twa_graph_ptr& aut_i,
|
||||||
const spot::const_tgba_digraph_ptr& aut_j,
|
const spot::const_twa_graph_ptr& aut_j,
|
||||||
size_t i, size_t j, bool icomp, bool jcomp)
|
size_t i, size_t j, bool icomp, bool jcomp)
|
||||||
{
|
{
|
||||||
auto prod = spot::product(aut_i, aut_j);
|
auto prod = spot::product(aut_i, aut_j);
|
||||||
|
|
@ -1022,12 +1022,12 @@ namespace
|
||||||
// These store the result of the translation of the positive and
|
// These store the result of the translation of the positive and
|
||||||
// negative formulas.
|
// negative formulas.
|
||||||
size_t m = translators.size();
|
size_t m = translators.size();
|
||||||
std::vector<spot::tgba_digraph_ptr> pos(m);
|
std::vector<spot::twa_graph_ptr> pos(m);
|
||||||
std::vector<spot::tgba_digraph_ptr> neg(m);
|
std::vector<spot::twa_graph_ptr> neg(m);
|
||||||
// These store the complement of the above results, when we can
|
// These store the complement of the above results, when we can
|
||||||
// compute it easily.
|
// compute it easily.
|
||||||
std::vector<spot::tgba_digraph_ptr> comp_pos(m);
|
std::vector<spot::twa_graph_ptr> comp_pos(m);
|
||||||
std::vector<spot::tgba_digraph_ptr> comp_neg(m);
|
std::vector<spot::twa_graph_ptr> comp_neg(m);
|
||||||
|
|
||||||
|
|
||||||
unsigned n = vstats.size();
|
unsigned n = vstats.size();
|
||||||
|
|
@ -1213,9 +1213,9 @@ namespace
|
||||||
<< " edges\n";
|
<< " edges\n";
|
||||||
|
|
||||||
// Products of the state space with the positive automata.
|
// Products of the state space with the positive automata.
|
||||||
std::vector<spot::const_tgba_digraph_ptr> pos_prod(m);
|
std::vector<spot::const_twa_graph_ptr> pos_prod(m);
|
||||||
// Products of the state space with the negative automata.
|
// Products of the state space with the negative automata.
|
||||||
std::vector<spot::const_tgba_digraph_ptr> neg_prod(m);
|
std::vector<spot::const_twa_graph_ptr> neg_prod(m);
|
||||||
// Associated SCC maps.
|
// Associated SCC maps.
|
||||||
std::vector<spot::scc_info*> pos_map(m);
|
std::vector<spot::scc_info*> pos_map(m);
|
||||||
std::vector<spot::scc_info*> neg_map(m);
|
std::vector<spot::scc_info*> neg_map(m);
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ namespace
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
spot::tgba_digraph_ptr
|
spot::twa_graph_ptr
|
||||||
translate(unsigned int translator_num, bool& problem, double& duration)
|
translate(unsigned int translator_num, bool& problem, double& duration)
|
||||||
{
|
{
|
||||||
output.reset(translator_num);
|
output.reset(translator_num);
|
||||||
|
|
@ -144,7 +144,7 @@ namespace
|
||||||
int es = exec_with_timeout(cmd.c_str());
|
int es = exec_with_timeout(cmd.c_str());
|
||||||
duration = sw.stop();
|
duration = sw.stop();
|
||||||
|
|
||||||
spot::tgba_digraph_ptr res = nullptr;
|
spot::twa_graph_ptr res = nullptr;
|
||||||
if (timed_out)
|
if (timed_out)
|
||||||
{
|
{
|
||||||
problem = false; // A timeout is considered benign
|
problem = false; // A timeout is considered benign
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ ARGMATCH_VERIFY(acc_args, acc_types);
|
||||||
|
|
||||||
|
|
||||||
static acc_type opt_acc = acc_buchi;
|
static acc_type opt_acc = acc_buchi;
|
||||||
typedef spot::tgba_digraph::graph_t::trans_storage_t tr_t;
|
typedef spot::twa_graph::graph_t::trans_storage_t tr_t;
|
||||||
typedef std::set<std::vector<tr_t>> unique_aut_t;
|
typedef std::set<std::vector<tr_t>> unique_aut_t;
|
||||||
static spot::ltl::atomic_prop_set aprops;
|
static spot::ltl::atomic_prop_set aprops;
|
||||||
static bool ap_count_given = false;
|
static bool ap_count_given = false;
|
||||||
|
|
@ -307,7 +307,7 @@ main(int argc, char** argv)
|
||||||
if (opt_uniq)
|
if (opt_uniq)
|
||||||
{
|
{
|
||||||
auto tmp = spot::canonicalize
|
auto tmp = spot::canonicalize
|
||||||
(make_tgba_digraph(aut, spot::twa::prop_set::all()));
|
(make_twa_graph(aut, spot::twa::prop_set::all()));
|
||||||
std::vector<tr_t> trans(tmp->transition_vector().begin() + 1,
|
std::vector<tr_t> trans(tmp->transition_vector().begin() + 1,
|
||||||
tmp->transition_vector().end());
|
tmp->transition_vector().end());
|
||||||
if (!opt_uniq->emplace(trans).second)
|
if (!opt_uniq->emplace(trans).second)
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ namespace spot
|
||||||
|
|
||||||
// This function is defined in nra2nba.cc, and used only here.
|
// This function is defined in nra2nba.cc, and used only here.
|
||||||
SPOT_LOCAL
|
SPOT_LOCAL
|
||||||
tgba_digraph_ptr nra_to_nba(const const_dstar_aut_ptr& nra,
|
twa_graph_ptr nra_to_nba(const const_dstar_aut_ptr& nra,
|
||||||
const const_tgba_ptr& aut);
|
const const_tgba_ptr& aut);
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
|
|
@ -217,7 +217,7 @@ namespace spot
|
||||||
const std::vector<bool>& realizable):
|
const std::vector<bool>& realizable):
|
||||||
tgba_reachable_iterator_depth_first(a->aut),
|
tgba_reachable_iterator_depth_first(a->aut),
|
||||||
in_(a),
|
in_(a),
|
||||||
out_(make_tgba_digraph(a->aut->get_dict())),
|
out_(make_twa_graph(a->aut->get_dict())),
|
||||||
final_(final),
|
final_(final),
|
||||||
num_states_(a->aut->num_states()),
|
num_states_(a->aut->num_states()),
|
||||||
sm_(sm),
|
sm_(sm),
|
||||||
|
|
@ -231,7 +231,7 @@ namespace spot
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
result()
|
result()
|
||||||
{
|
{
|
||||||
return out_;
|
return out_;
|
||||||
|
|
@ -291,7 +291,7 @@ namespace spot
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const const_dstar_aut_ptr& in_;
|
const const_dstar_aut_ptr& in_;
|
||||||
tgba_digraph_ptr out_;
|
twa_graph_ptr out_;
|
||||||
const state_set& final_;
|
const state_set& final_;
|
||||||
size_t num_states_;
|
size_t num_states_;
|
||||||
acc_cond::mark_t acc_;
|
acc_cond::mark_t acc_;
|
||||||
|
|
@ -302,7 +302,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tgba_digraph_ptr dra_to_ba(const const_dstar_aut_ptr& dra, bool* dba)
|
twa_graph_ptr dra_to_ba(const const_dstar_aut_ptr& dra, bool* dba)
|
||||||
{
|
{
|
||||||
assert(dra->type == Rabin);
|
assert(dra->type == Rabin);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
dstar_to_tgba(const const_dstar_aut_ptr& daut)
|
dstar_to_tgba(const const_dstar_aut_ptr& daut)
|
||||||
{
|
{
|
||||||
switch (daut->type)
|
switch (daut->type)
|
||||||
|
|
|
||||||
|
|
@ -330,7 +330,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
result_ r;
|
result_ r;
|
||||||
r.d = std::make_shared<spot::dstar_aut>();
|
r.d = std::make_shared<spot::dstar_aut>();
|
||||||
r.d->aut = make_tgba_digraph(dict);
|
r.d->aut = make_twa_graph(dict);
|
||||||
r.d->accsets = 0;
|
r.d->accsets = 0;
|
||||||
r.env = &env;
|
r.env = &env;
|
||||||
dstaryy::parser parser(error_list, r);
|
dstaryy::parser parser(error_list, r);
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ namespace spot
|
||||||
// makes its possible to mask AUT, as needed in dra_to_ba().
|
// makes its possible to mask AUT, as needed in dra_to_ba().
|
||||||
nra_to_nba_worker(const const_dstar_aut_ptr& a, const_tgba_ptr aut):
|
nra_to_nba_worker(const const_dstar_aut_ptr& a, const_tgba_ptr aut):
|
||||||
tgba_reachable_iterator_depth_first(aut),
|
tgba_reachable_iterator_depth_first(aut),
|
||||||
out_(make_tgba_digraph(aut->get_dict())),
|
out_(make_twa_graph(aut->get_dict())),
|
||||||
d_(a),
|
d_(a),
|
||||||
num_states_(a->aut->num_states())
|
num_states_(a->aut->num_states())
|
||||||
{
|
{
|
||||||
|
|
@ -55,7 +55,7 @@ namespace spot
|
||||||
i->destroy();
|
i->destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
result()
|
result()
|
||||||
{
|
{
|
||||||
return out_;
|
return out_;
|
||||||
|
|
@ -105,7 +105,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
tgba_digraph_ptr out_;
|
twa_graph_ptr out_;
|
||||||
const_dstar_aut_ptr d_;
|
const_dstar_aut_ptr d_;
|
||||||
size_t num_states_;
|
size_t num_states_;
|
||||||
};
|
};
|
||||||
|
|
@ -115,7 +115,7 @@ namespace spot
|
||||||
// In dra_to_dba() we call this function with a second argument
|
// In dra_to_dba() we call this function with a second argument
|
||||||
// that is a masked version of nra->aut.
|
// that is a masked version of nra->aut.
|
||||||
SPOT_LOCAL
|
SPOT_LOCAL
|
||||||
tgba_digraph_ptr nra_to_nba(const const_dstar_aut_ptr& nra,
|
twa_graph_ptr nra_to_nba(const const_dstar_aut_ptr& nra,
|
||||||
const const_tgba_ptr& aut)
|
const const_tgba_ptr& aut)
|
||||||
{
|
{
|
||||||
assert(nra->type == Rabin);
|
assert(nra->type == Rabin);
|
||||||
|
|
@ -124,7 +124,7 @@ namespace spot
|
||||||
return scc_filter_states(w.result());
|
return scc_filter_states(w.result());
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr nra_to_nba(const const_dstar_aut_ptr& nra)
|
twa_graph_ptr nra_to_nba(const const_dstar_aut_ptr& nra)
|
||||||
{
|
{
|
||||||
return nra_to_nba(nra, nra->aut);
|
return nra_to_nba(nra, nra->aut);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -98,11 +98,11 @@ namespace spot
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr nsa_to_tgba(const const_dstar_aut_ptr& nsa)
|
twa_graph_ptr nsa_to_tgba(const const_dstar_aut_ptr& nsa)
|
||||||
{
|
{
|
||||||
assert(nsa->type == Streett);
|
assert(nsa->type == Streett);
|
||||||
auto a = nsa->aut;
|
auto a = nsa->aut;
|
||||||
auto res = make_tgba_digraph(a->get_dict());
|
auto res = make_twa_graph(a->get_dict());
|
||||||
res->copy_ap_of(a);
|
res->copy_ap_of(a);
|
||||||
|
|
||||||
// Create accpair_count acceptance sets for the output.
|
// Create accpair_count acceptance sets for the output.
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ namespace spot
|
||||||
{
|
{
|
||||||
// Transition structure of the automaton.
|
// Transition structure of the automaton.
|
||||||
// This is encoded as a TGBA without acceptance condition.
|
// This is encoded as a TGBA without acceptance condition.
|
||||||
tgba_digraph_ptr aut;
|
twa_graph_ptr aut;
|
||||||
/// Type of the acceptance.
|
/// Type of the acceptance.
|
||||||
dstar_type type;
|
dstar_type type;
|
||||||
/// Number of acceptance pairs.
|
/// Number of acceptance pairs.
|
||||||
|
|
@ -68,7 +68,7 @@ namespace spot
|
||||||
typedef std::shared_ptr<dstar_aut> dstar_aut_ptr;
|
typedef std::shared_ptr<dstar_aut> dstar_aut_ptr;
|
||||||
typedef std::shared_ptr<const dstar_aut> const_dstar_aut_ptr;
|
typedef std::shared_ptr<const dstar_aut> const_dstar_aut_ptr;
|
||||||
|
|
||||||
/// \brief Build a spot::tgba_digraph from ltl2dstar's output.
|
/// \brief Build a spot::twa_graph from ltl2dstar's output.
|
||||||
/// \param filename The name of the file to parse.
|
/// \param filename The name of the file to parse.
|
||||||
/// \param error_list A list that will be filled with
|
/// \param error_list A list that will be filled with
|
||||||
/// parse errors that occured during parsing.
|
/// parse errors that occured during parsing.
|
||||||
|
|
@ -106,14 +106,14 @@ namespace spot
|
||||||
|
|
||||||
/// \brief Convert a non-deterministic Rabin automaton into a
|
/// \brief Convert a non-deterministic Rabin automaton into a
|
||||||
/// non-deterministic Büchi automaton.
|
/// non-deterministic Büchi automaton.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
nra_to_nba(const const_dstar_aut_ptr& nra);
|
nra_to_nba(const const_dstar_aut_ptr& nra);
|
||||||
|
|
||||||
/// \brief Convert a non-deterministic Rabin automaton into a
|
/// \brief Convert a non-deterministic Rabin automaton into a
|
||||||
/// non-deterministic Büchi automaton.
|
/// non-deterministic Büchi automaton.
|
||||||
///
|
///
|
||||||
/// This version simply ignores all states in \a ignore.
|
/// This version simply ignores all states in \a ignore.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
nra_to_nba(const const_dstar_aut_ptr& nra, const state_set* ignore);
|
nra_to_nba(const const_dstar_aut_ptr& nra, const state_set* ignore);
|
||||||
|
|
||||||
/// \brief Convert a deterministic Rabin automaton into a
|
/// \brief Convert a deterministic Rabin automaton into a
|
||||||
|
|
@ -132,18 +132,18 @@ namespace spot
|
||||||
/// If the optional \a dba_output argument is non-null, the
|
/// If the optional \a dba_output argument is non-null, the
|
||||||
/// pointed Boolean will be updated to indicate whether the
|
/// pointed Boolean will be updated to indicate whether the
|
||||||
/// returned Büchi automaton is deterministic.
|
/// returned Büchi automaton is deterministic.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
dra_to_ba(const const_dstar_aut_ptr& dra, bool* dba_output = 0);
|
dra_to_ba(const const_dstar_aut_ptr& dra, bool* dba_output = 0);
|
||||||
|
|
||||||
/// \brief Convert a non-deterministic Streett automaton into a
|
/// \brief Convert a non-deterministic Streett automaton into a
|
||||||
/// non-deterministic tgba.
|
/// non-deterministic tgba.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
nsa_to_tgba(const const_dstar_aut_ptr& nra);
|
nsa_to_tgba(const const_dstar_aut_ptr& nra);
|
||||||
|
|
||||||
/// \brief Convert a Rabin or Streett automaton into a TGBA.
|
/// \brief Convert a Rabin or Streett automaton into a TGBA.
|
||||||
///
|
///
|
||||||
/// This function calls dra_to_ba() or nsa_to_tgba().
|
/// This function calls dra_to_ba() or nsa_to_tgba().
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
dstar_to_tgba(const const_dstar_aut_ptr& dstar);
|
dstar_to_tgba(const const_dstar_aut_ptr& dstar);
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ void f1()
|
||||||
|
|
||||||
auto& e = spot::ltl::default_environment::instance();
|
auto& e = spot::ltl::default_environment::instance();
|
||||||
|
|
||||||
auto tg = make_tgba_digraph(d);
|
auto tg = make_twa_graph(d);
|
||||||
|
|
||||||
auto* f1 = e.require("p1");
|
auto* f1 = e.require("p1");
|
||||||
auto* f2 = e.require("p2");
|
auto* f2 = e.require("p2");
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
typedef std::map<std::string, bdd> formula_cache;
|
typedef std::map<std::string, bdd> formula_cache;
|
||||||
|
|
||||||
typedef std::pair<int, std::string*> pair;
|
typedef std::pair<int, std::string*> pair;
|
||||||
typedef typename spot::tgba_digraph::namer<std::string>::type named_tgba_t;
|
typedef typename spot::twa_graph::namer<std::string>::type named_tgba_t;
|
||||||
|
|
||||||
// Note: because this parser is meant to be used on a stream of
|
// Note: because this parser is meant to be used on a stream of
|
||||||
// automata, it tries hard to recover from errors, so that we get a
|
// automata, it tries hard to recover from errors, so that we get a
|
||||||
|
|
@ -1682,7 +1682,7 @@ namespace spot
|
||||||
restart:
|
restart:
|
||||||
result_ r;
|
result_ r;
|
||||||
r.h = std::make_shared<spot::hoa_aut>();
|
r.h = std::make_shared<spot::hoa_aut>();
|
||||||
r.h->aut = make_tgba_digraph(dict);
|
r.h->aut = make_twa_graph(dict);
|
||||||
r.env = &env;
|
r.env = &env;
|
||||||
hoayy::parser parser(error_list, r, last_loc);
|
hoayy::parser parser(error_list, r, last_loc);
|
||||||
static bool env_debug = !!getenv("SPOT_DEBUG_PARSER");
|
static bool env_debug = !!getenv("SPOT_DEBUG_PARSER");
|
||||||
|
|
@ -1717,7 +1717,7 @@ namespace spot
|
||||||
return r.h;
|
return r.h;
|
||||||
};
|
};
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
hoa_stream_parser::parse_strict(const bdd_dict_ptr& dict,
|
hoa_stream_parser::parse_strict(const bdd_dict_ptr& dict,
|
||||||
ltl::environment& env,
|
ltl::environment& env,
|
||||||
bool debug)
|
bool debug)
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ namespace spot
|
||||||
{
|
{
|
||||||
// Transition structure of the automaton.
|
// Transition structure of the automaton.
|
||||||
// This is encoded as a TGBA without acceptance condition.
|
// This is encoded as a TGBA without acceptance condition.
|
||||||
tgba_digraph_ptr aut;
|
twa_graph_ptr aut;
|
||||||
bool aborted = false;
|
bool aborted = false;
|
||||||
spot::location loc;
|
spot::location loc;
|
||||||
};
|
};
|
||||||
|
|
@ -75,13 +75,13 @@ namespace spot
|
||||||
ltl::default_environment::instance(),
|
ltl::default_environment::instance(),
|
||||||
bool debug = false);
|
bool debug = false);
|
||||||
// Raises a parse_error on any syntax error
|
// Raises a parse_error on any syntax error
|
||||||
tgba_digraph_ptr parse_strict(const bdd_dict_ptr& dict,
|
twa_graph_ptr parse_strict(const bdd_dict_ptr& dict,
|
||||||
ltl::environment& env =
|
ltl::environment& env =
|
||||||
ltl::default_environment::instance(),
|
ltl::default_environment::instance(),
|
||||||
bool debug = false);
|
bool debug = false);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \brief Build a spot::tgba_digraph from a HOA file or a neverclaim.
|
/// \brief Build a spot::twa_graph from a HOA file or a neverclaim.
|
||||||
/// \param filename The name of the file to parse.
|
/// \param filename The name of the file to parse.
|
||||||
/// \param error_list A list that will be filled with
|
/// \param error_list A list that will be filled with
|
||||||
/// parse errors that occured during parsing.
|
/// parse errors that occured during parsing.
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ namespace spot
|
||||||
{
|
{
|
||||||
struct record_
|
struct record_
|
||||||
{
|
{
|
||||||
const_tgba_digraph_ptr translation;
|
const_twa_graph_ptr translation;
|
||||||
typedef std::map<const record_*, bool> incomp_map;
|
typedef std::map<const record_*, bool> incomp_map;
|
||||||
incomp_map incompatible;
|
incomp_map incompatible;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ namespace spot
|
||||||
return ltl::multop::instance(ltl::multop::And, f->clone(), c);
|
return ltl::multop::instance(ltl::multop::And, f->clone(), c);
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr exclusive_ap::constrain(const_tgba_digraph_ptr aut,
|
twa_graph_ptr exclusive_ap::constrain(const_twa_graph_ptr aut,
|
||||||
bool simplify_guards) const
|
bool simplify_guards) const
|
||||||
{
|
{
|
||||||
// Compute the support of the automaton.
|
// Compute the support of the automaton.
|
||||||
|
|
@ -194,7 +194,7 @@ namespace spot
|
||||||
restrict &= group[j] | group[k];
|
restrict &= group[j] | group[k];
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr res = make_tgba_digraph(aut->get_dict());
|
twa_graph_ptr res = make_twa_graph(aut->get_dict());
|
||||||
res->copy_ap_of(aut);
|
res->copy_ap_of(aut);
|
||||||
res->prop_copy(aut, { true, true, true, true });
|
res->prop_copy(aut, { true, true, true, true });
|
||||||
res->copy_acceptance_of(aut);
|
res->copy_acceptance_of(aut);
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
const ltl::formula* constrain(const ltl::formula* f) const;
|
const ltl::formula* constrain(const ltl::formula* f) const;
|
||||||
tgba_digraph_ptr constrain(const_tgba_digraph_ptr aut,
|
twa_graph_ptr constrain(const_twa_graph_ptr aut,
|
||||||
bool simplify_guards = false) const;
|
bool simplify_guards = false) const;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,9 @@ namespace spot
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
bdd_dict_ptr dict_;
|
bdd_dict_ptr dict_;
|
||||||
tgba_digraph_ptr aut_;
|
twa_graph_ptr aut_;
|
||||||
|
|
||||||
acc_mapper_common(const tgba_digraph_ptr& aut)
|
acc_mapper_common(const twa_graph_ptr& aut)
|
||||||
: dict_(aut->get_dict()), aut_(aut)
|
: dict_(aut->get_dict()), aut_(aut)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -43,7 +43,7 @@ namespace spot
|
||||||
std::unordered_map<std::string, unsigned> map_;
|
std::unordered_map<std::string, unsigned> map_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
acc_mapper_string(const tgba_digraph_ptr& aut)
|
acc_mapper_string(const twa_graph_ptr& aut)
|
||||||
: acc_mapper_common(aut)
|
: acc_mapper_common(aut)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -73,7 +73,7 @@ namespace spot
|
||||||
class acc_mapper_consecutive_int: public acc_mapper_common
|
class acc_mapper_consecutive_int: public acc_mapper_common
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
acc_mapper_consecutive_int(const tgba_digraph_ptr& aut, unsigned count)
|
acc_mapper_consecutive_int(const twa_graph_ptr& aut, unsigned count)
|
||||||
: acc_mapper_common(aut)
|
: acc_mapper_common(aut)
|
||||||
{
|
{
|
||||||
std::vector<unsigned> vmap(count);
|
std::vector<unsigned> vmap(count);
|
||||||
|
|
@ -97,7 +97,7 @@ namespace spot
|
||||||
std::map<unsigned, acc_cond::mark_t> map_;
|
std::map<unsigned, acc_cond::mark_t> map_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
acc_mapper_int(const tgba_digraph_ptr& aut, unsigned count)
|
acc_mapper_int(const twa_graph_ptr& aut, unsigned count)
|
||||||
: acc_mapper_consecutive_int(aut, count), used_(0)
|
: acc_mapper_consecutive_int(aut, count), used_(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ namespace spot
|
||||||
// automaton
|
// automaton
|
||||||
static void
|
static void
|
||||||
build_result(const const_ta_ptr& a, std::list<hash_set*>& sets,
|
build_result(const const_ta_ptr& a, std::list<hash_set*>& sets,
|
||||||
tgba_digraph_ptr result_tgba, const ta_explicit_ptr& result)
|
twa_graph_ptr result_tgba, const ta_explicit_ptr& result)
|
||||||
{
|
{
|
||||||
// For each set, create a state in the tgbaulting automaton.
|
// For each set, create a state in the tgbaulting automaton.
|
||||||
// For a state s, state_num[s] is the number of the state in the minimal
|
// For a state s, state_num[s] is the number of the state in the minimal
|
||||||
|
|
@ -508,7 +508,7 @@ namespace spot
|
||||||
minimize_ta(const const_ta_ptr& ta_)
|
minimize_ta(const const_ta_ptr& ta_)
|
||||||
{
|
{
|
||||||
|
|
||||||
auto tgba = make_tgba_digraph(ta_->get_dict());
|
auto tgba = make_twa_graph(ta_->get_dict());
|
||||||
auto res = make_ta_explicit(tgba, ta_->acc().num_sets(), 0);
|
auto res = make_ta_explicit(tgba, ta_->acc().num_sets(), 0);
|
||||||
|
|
||||||
partition_t partition = build_partition(ta_);
|
partition_t partition = build_partition(ta_);
|
||||||
|
|
@ -528,7 +528,7 @@ namespace spot
|
||||||
minimize_tgta(const const_tgta_explicit_ptr& tgta_)
|
minimize_tgta(const const_tgta_explicit_ptr& tgta_)
|
||||||
{
|
{
|
||||||
|
|
||||||
auto tgba = make_tgba_digraph(tgta_->get_dict());
|
auto tgba = make_twa_graph(tgta_->get_dict());
|
||||||
auto res = make_tgta_explicit(tgba, tgta_->acc().num_sets(), 0);
|
auto res = make_tgta_explicit(tgba, tgta_->acc().num_sets(), 0);
|
||||||
|
|
||||||
auto ta = tgta_->get_ta();
|
auto ta = tgta_->get_ta();
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,9 @@ namespace spot
|
||||||
typedef std::shared_ptr<twa> tgba_ptr;
|
typedef std::shared_ptr<twa> tgba_ptr;
|
||||||
typedef std::shared_ptr<const twa> const_tgba_ptr;
|
typedef std::shared_ptr<const twa> const_tgba_ptr;
|
||||||
|
|
||||||
class tgba_digraph;
|
class twa_graph;
|
||||||
typedef std::shared_ptr<const tgba_digraph> const_tgba_digraph_ptr;
|
typedef std::shared_ptr<const twa_graph> const_twa_graph_ptr;
|
||||||
typedef std::shared_ptr<tgba_digraph> tgba_digraph_ptr;
|
typedef std::shared_ptr<twa_graph> twa_graph_ptr;
|
||||||
|
|
||||||
class tgba_product;
|
class tgba_product;
|
||||||
typedef std::shared_ptr<const tgba_product> const_tgba_product_ptr;
|
typedef std::shared_ptr<const tgba_product> const_tgba_product_ptr;
|
||||||
|
|
|
||||||
|
|
@ -82,9 +82,9 @@ namespace spot
|
||||||
auto a = shared_from_this();
|
auto a = shared_from_this();
|
||||||
if (a->acc().uses_fin_acceptance())
|
if (a->acc().uses_fin_acceptance())
|
||||||
{
|
{
|
||||||
auto aa = std::dynamic_pointer_cast<const tgba_digraph>(a);
|
auto aa = std::dynamic_pointer_cast<const twa_graph>(a);
|
||||||
if (!aa)
|
if (!aa)
|
||||||
aa = make_tgba_digraph(a, prop_set::all());
|
aa = make_twa_graph(a, prop_set::all());
|
||||||
a = remove_fin(aa);
|
a = remove_fin(aa);
|
||||||
}
|
}
|
||||||
return !couvreur99(a)->check();
|
return !couvreur99(a)->check();
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
|
|
||||||
void tgba_digraph::merge_transitions()
|
void twa_graph::merge_transitions()
|
||||||
{
|
{
|
||||||
g_.remove_dead_transitions_();
|
g_.remove_dead_transitions_();
|
||||||
|
|
||||||
|
|
@ -130,7 +130,7 @@ namespace spot
|
||||||
g_.chain_transitions_();
|
g_.chain_transitions_();
|
||||||
}
|
}
|
||||||
|
|
||||||
void tgba_digraph::purge_unreachable_states()
|
void twa_graph::purge_unreachable_states()
|
||||||
{
|
{
|
||||||
unsigned num_states = g_.num_states();
|
unsigned num_states = g_.num_states();
|
||||||
if (SPOT_UNLIKELY(num_states == 0))
|
if (SPOT_UNLIKELY(num_states == 0))
|
||||||
|
|
@ -173,7 +173,7 @@ namespace spot
|
||||||
g_.defrag_states(std::move(todo), current);
|
g_.defrag_states(std::move(todo), current);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tgba_digraph::purge_dead_states()
|
void twa_graph::purge_dead_states()
|
||||||
{
|
{
|
||||||
unsigned num_states = g_.num_states();
|
unsigned num_states = g_.num_states();
|
||||||
if (num_states == 0)
|
if (num_states == 0)
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ namespace spot
|
||||||
|
|
||||||
|
|
||||||
template<class Graph>
|
template<class Graph>
|
||||||
class SPOT_API tgba_digraph_succ_iterator final:
|
class SPOT_API twa_graph_succ_iterator final:
|
||||||
public tgba_succ_iterator
|
public tgba_succ_iterator
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
@ -116,7 +116,7 @@ namespace spot
|
||||||
transition p_;
|
transition p_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
tgba_digraph_succ_iterator(const Graph* g, transition t)
|
twa_graph_succ_iterator(const Graph* g, transition t)
|
||||||
: g_(g), t_(t)
|
: g_(g), t_(t)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -169,7 +169,7 @@ namespace spot
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class SPOT_API tgba_digraph final: public twa
|
class SPOT_API twa_graph final: public twa
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef digraph<tgba_graph_state, tgba_graph_trans_data> graph_t;
|
typedef digraph<tgba_graph_state, tgba_graph_trans_data> graph_t;
|
||||||
|
|
@ -180,13 +180,13 @@ namespace spot
|
||||||
mutable unsigned init_number_;
|
mutable unsigned init_number_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
tgba_digraph(const bdd_dict_ptr& dict)
|
twa_graph(const bdd_dict_ptr& dict)
|
||||||
: twa(dict),
|
: twa(dict),
|
||||||
init_number_(0)
|
init_number_(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
explicit tgba_digraph(const const_tgba_digraph_ptr& other, prop_set p)
|
explicit twa_graph(const const_twa_graph_ptr& other, prop_set p)
|
||||||
: twa(other->get_dict()),
|
: twa(other->get_dict()),
|
||||||
g_(other->g_), init_number_(other->init_number_)
|
g_(other->g_), init_number_(other->init_number_)
|
||||||
{
|
{
|
||||||
|
|
@ -195,7 +195,7 @@ namespace spot
|
||||||
prop_copy(other, p);
|
prop_copy(other, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~tgba_digraph()
|
virtual ~twa_graph()
|
||||||
{
|
{
|
||||||
get_dict()->unregister_all_my_variables(this);
|
get_dict()->unregister_all_my_variables(this);
|
||||||
// Prevent this state from being destroyed by ~twa(),
|
// Prevent this state from being destroyed by ~twa(),
|
||||||
|
|
@ -278,12 +278,12 @@ namespace spot
|
||||||
if (this->iter_cache_)
|
if (this->iter_cache_)
|
||||||
{
|
{
|
||||||
auto it =
|
auto it =
|
||||||
down_cast<tgba_digraph_succ_iterator<graph_t>*>(this->iter_cache_);
|
down_cast<twa_graph_succ_iterator<graph_t>*>(this->iter_cache_);
|
||||||
it->recycle(s->succ);
|
it->recycle(s->succ);
|
||||||
this->iter_cache_ = nullptr;
|
this->iter_cache_ = nullptr;
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
return new tgba_digraph_succ_iterator<graph_t>(&g_, s->succ);
|
return new twa_graph_succ_iterator<graph_t>(&g_, s->succ);
|
||||||
}
|
}
|
||||||
|
|
||||||
graph_t::state
|
graph_t::state
|
||||||
|
|
@ -314,7 +314,7 @@ namespace spot
|
||||||
|
|
||||||
tgba_graph_trans_data& trans_data(const tgba_succ_iterator* it)
|
tgba_graph_trans_data& trans_data(const tgba_succ_iterator* it)
|
||||||
{
|
{
|
||||||
auto* i = down_cast<const tgba_digraph_succ_iterator<graph_t>*>(it);
|
auto* i = down_cast<const twa_graph_succ_iterator<graph_t>*>(it);
|
||||||
return g_.trans_data(i->pos());
|
return g_.trans_data(i->pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -325,7 +325,7 @@ namespace spot
|
||||||
|
|
||||||
const tgba_graph_trans_data& trans_data(const tgba_succ_iterator* it) const
|
const tgba_graph_trans_data& trans_data(const tgba_succ_iterator* it) const
|
||||||
{
|
{
|
||||||
auto* i = down_cast<const tgba_digraph_succ_iterator<graph_t>*>(it);
|
auto* i = down_cast<const twa_graph_succ_iterator<graph_t>*>(it);
|
||||||
return g_.trans_data(i->pos());
|
return g_.trans_data(i->pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -336,7 +336,7 @@ namespace spot
|
||||||
|
|
||||||
trans_storage_t& trans_storage(const tgba_succ_iterator* it)
|
trans_storage_t& trans_storage(const tgba_succ_iterator* it)
|
||||||
{
|
{
|
||||||
auto* i = down_cast<const tgba_digraph_succ_iterator<graph_t>*>(it);
|
auto* i = down_cast<const twa_graph_succ_iterator<graph_t>*>(it);
|
||||||
return g_.trans_storage(i->pos());
|
return g_.trans_storage(i->pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -348,7 +348,7 @@ namespace spot
|
||||||
const trans_storage_t
|
const trans_storage_t
|
||||||
trans_storage(const tgba_succ_iterator* it) const
|
trans_storage(const tgba_succ_iterator* it) const
|
||||||
{
|
{
|
||||||
auto* i = down_cast<const tgba_digraph_succ_iterator<graph_t>*>(it);
|
auto* i = down_cast<const twa_graph_succ_iterator<graph_t>*>(it);
|
||||||
return g_.trans_storage(i->pos());
|
return g_.trans_storage(i->pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -440,7 +440,7 @@ namespace spot
|
||||||
return state_is_accepting(state_number(s));
|
return state_is_accepting(state_number(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const tgba_digraph& aut) const
|
bool operator==(const twa_graph& aut) const
|
||||||
{
|
{
|
||||||
if (num_states() != aut.num_states() ||
|
if (num_states() != aut.num_states() ||
|
||||||
num_transitions() != aut.num_transitions() ||
|
num_transitions() != aut.num_transitions() ||
|
||||||
|
|
@ -453,29 +453,29 @@ namespace spot
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline tgba_digraph_ptr make_tgba_digraph(const bdd_dict_ptr& dict)
|
inline twa_graph_ptr make_twa_graph(const bdd_dict_ptr& dict)
|
||||||
{
|
{
|
||||||
return std::make_shared<tgba_digraph>(dict);
|
return std::make_shared<twa_graph>(dict);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline tgba_digraph_ptr make_tgba_digraph(const tgba_digraph_ptr& aut,
|
inline twa_graph_ptr make_twa_graph(const twa_graph_ptr& aut,
|
||||||
twa::prop_set p)
|
twa::prop_set p)
|
||||||
{
|
{
|
||||||
return std::make_shared<tgba_digraph>(aut, p);
|
return std::make_shared<twa_graph>(aut, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline tgba_digraph_ptr make_tgba_digraph(const const_tgba_digraph_ptr& aut,
|
inline twa_graph_ptr make_twa_graph(const const_twa_graph_ptr& aut,
|
||||||
twa::prop_set p)
|
twa::prop_set p)
|
||||||
{
|
{
|
||||||
return std::make_shared<tgba_digraph>(aut, p);
|
return std::make_shared<twa_graph>(aut, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline tgba_digraph_ptr make_tgba_digraph(const const_tgba_ptr& aut,
|
inline twa_graph_ptr make_twa_graph(const const_tgba_ptr& aut,
|
||||||
twa::prop_set p)
|
twa::prop_set p)
|
||||||
{
|
{
|
||||||
auto a = std::dynamic_pointer_cast<const tgba_digraph>(aut);
|
auto a = std::dynamic_pointer_cast<const twa_graph>(aut);
|
||||||
if (a)
|
if (a)
|
||||||
return std::make_shared<tgba_digraph>(a, p);
|
return std::make_shared<twa_graph>(a, p);
|
||||||
else
|
else
|
||||||
return tgba_dupexp_dfs(aut, p);
|
return tgba_dupexp_dfs(aut, p);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ namespace spot
|
||||||
/// \brief Automaton with Safra's tree as states.
|
/// \brief Automaton with Safra's tree as states.
|
||||||
struct safra_tree_automaton
|
struct safra_tree_automaton
|
||||||
{
|
{
|
||||||
safra_tree_automaton(const const_tgba_digraph_ptr& sba);
|
safra_tree_automaton(const const_twa_graph_ptr& sba);
|
||||||
~safra_tree_automaton();
|
~safra_tree_automaton();
|
||||||
typedef std::map<bdd, const safra_tree*, bdd_less_than> transition_list;
|
typedef std::map<bdd, const safra_tree*, bdd_less_than> transition_list;
|
||||||
typedef
|
typedef
|
||||||
|
|
@ -66,14 +66,14 @@ namespace spot
|
||||||
int get_nb_acceptance_pairs() const;
|
int get_nb_acceptance_pairs() const;
|
||||||
safra_tree* get_initial_state() const;
|
safra_tree* get_initial_state() const;
|
||||||
void set_initial_state(safra_tree* s);
|
void set_initial_state(safra_tree* s);
|
||||||
const const_tgba_digraph_ptr& get_sba(void) const
|
const const_twa_graph_ptr& get_sba(void) const
|
||||||
{
|
{
|
||||||
return a_;
|
return a_;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
mutable int max_nb_pairs_;
|
mutable int max_nb_pairs_;
|
||||||
safra_tree* initial_state;
|
safra_tree* initial_state;
|
||||||
const_tgba_digraph_ptr a_;
|
const_twa_graph_ptr a_;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \brief A Safra tree, used as state during the determinization
|
/// \brief A Safra tree, used as state during the determinization
|
||||||
|
|
@ -111,7 +111,7 @@ namespace spot
|
||||||
int max_name() const;
|
int max_name() const;
|
||||||
|
|
||||||
// Operations to get successors of a tree.
|
// Operations to get successors of a tree.
|
||||||
safra_tree* branch_accepting(const tgba_digraph& a);
|
safra_tree* branch_accepting(const twa_graph& a);
|
||||||
safra_tree* succ_create(const bdd& condition,
|
safra_tree* succ_create(const bdd& condition,
|
||||||
cache_t& cache_transition);
|
cache_t& cache_transition);
|
||||||
safra_tree* normalize_siblings();
|
safra_tree* normalize_siblings();
|
||||||
|
|
@ -313,7 +313,7 @@ namespace spot
|
||||||
/// is inserted with the set of all accepting states of \c nodes
|
/// is inserted with the set of all accepting states of \c nodes
|
||||||
/// as label and an unused name.
|
/// as label and an unused name.
|
||||||
safra_tree*
|
safra_tree*
|
||||||
safra_tree::branch_accepting(const tgba_digraph& a)
|
safra_tree::branch_accepting(const twa_graph& a)
|
||||||
{
|
{
|
||||||
for (auto c: children)
|
for (auto c: children)
|
||||||
c->branch_accepting(a);
|
c->branch_accepting(a);
|
||||||
|
|
@ -568,12 +568,12 @@ namespace spot
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static safra_tree_automaton*
|
static safra_tree_automaton*
|
||||||
create_safra_automaton(const const_tgba_digraph_ptr& a);
|
create_safra_automaton(const const_twa_graph_ptr& a);
|
||||||
private:
|
private:
|
||||||
typedef std::set<int> atomic_list_t;
|
typedef std::set<int> atomic_list_t;
|
||||||
typedef std::set<bdd, bdd_less_than> conjunction_list_t;
|
typedef std::set<bdd, bdd_less_than> conjunction_list_t;
|
||||||
static void retrieve_atomics(const safra_tree* node,
|
static void retrieve_atomics(const safra_tree* node,
|
||||||
tgba_digraph_ptr sba_aut,
|
twa_graph_ptr sba_aut,
|
||||||
safra_tree::cache_t& cache,
|
safra_tree::cache_t& cache,
|
||||||
atomic_list_t& atomic_list);
|
atomic_list_t& atomic_list);
|
||||||
static void set_atomic_list(atomic_list_t& list, bdd condition);
|
static void set_atomic_list(atomic_list_t& list, bdd condition);
|
||||||
|
|
@ -584,7 +584,7 @@ namespace spot
|
||||||
/// \brief The body of Safra's construction.
|
/// \brief The body of Safra's construction.
|
||||||
safra_tree_automaton*
|
safra_tree_automaton*
|
||||||
safra_determinisation::create_safra_automaton
|
safra_determinisation::create_safra_automaton
|
||||||
(const const_tgba_digraph_ptr& a)
|
(const const_twa_graph_ptr& a)
|
||||||
{
|
{
|
||||||
// initialization.
|
// initialization.
|
||||||
auto sba_aut = degeneralize(a);
|
auto sba_aut = degeneralize(a);
|
||||||
|
|
@ -664,7 +664,7 @@ namespace spot
|
||||||
/// of the states in the label of the node.
|
/// of the states in the label of the node.
|
||||||
void
|
void
|
||||||
safra_determinisation::retrieve_atomics(const safra_tree* node,
|
safra_determinisation::retrieve_atomics(const safra_tree* node,
|
||||||
tgba_digraph_ptr sba_aut,
|
twa_graph_ptr sba_aut,
|
||||||
safra_tree::cache_t& cache,
|
safra_tree::cache_t& cache,
|
||||||
atomic_list_t& atomic_list)
|
atomic_list_t& atomic_list)
|
||||||
{
|
{
|
||||||
|
|
@ -1031,7 +1031,7 @@ namespace spot
|
||||||
// safra_tree_automaton
|
// safra_tree_automaton
|
||||||
////////////////////////
|
////////////////////////
|
||||||
|
|
||||||
safra_tree_automaton::safra_tree_automaton(const const_tgba_digraph_ptr& a)
|
safra_tree_automaton::safra_tree_automaton(const const_twa_graph_ptr& a)
|
||||||
: max_nb_pairs_(-1), initial_state(0), a_(a)
|
: max_nb_pairs_(-1), initial_state(0), a_(a)
|
||||||
{
|
{
|
||||||
a->get_dict()->register_all_variables_of(a, this);
|
a->get_dict()->register_all_variables_of(a, this);
|
||||||
|
|
@ -1073,7 +1073,7 @@ namespace spot
|
||||||
// tgba_safra_complement
|
// tgba_safra_complement
|
||||||
//////////////////////////
|
//////////////////////////
|
||||||
|
|
||||||
tgba_safra_complement::tgba_safra_complement(const const_tgba_digraph_ptr& a)
|
tgba_safra_complement::tgba_safra_complement(const const_twa_graph_ptr& a)
|
||||||
: twa(a->get_dict()), automaton_(a),
|
: twa(a->get_dict()), automaton_(a),
|
||||||
safra_(safra_determinisation::create_safra_automaton(a))
|
safra_(safra_determinisation::create_safra_automaton(a))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ namespace spot
|
||||||
class SPOT_API tgba_safra_complement : public twa
|
class SPOT_API tgba_safra_complement : public twa
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
tgba_safra_complement(const const_tgba_digraph_ptr& a);
|
tgba_safra_complement(const const_twa_graph_ptr& a);
|
||||||
virtual ~tgba_safra_complement();
|
virtual ~tgba_safra_complement();
|
||||||
|
|
||||||
// tgba interface.
|
// tgba interface.
|
||||||
|
|
@ -66,7 +66,7 @@ namespace spot
|
||||||
protected:
|
protected:
|
||||||
virtual bdd compute_support_conditions(const state* state) const;
|
virtual bdd compute_support_conditions(const state* state) const;
|
||||||
private:
|
private:
|
||||||
const_tgba_digraph_ptr automaton_;
|
const_twa_graph_ptr automaton_;
|
||||||
void* safra_;
|
void* safra_;
|
||||||
#if TRANSFORM_TO_TBA
|
#if TRANSFORM_TO_TBA
|
||||||
acc_cond::mark_t the_acceptance_cond_;
|
acc_cond::mark_t the_acceptance_cond_;
|
||||||
|
|
@ -81,7 +81,7 @@ namespace spot
|
||||||
typedef std::shared_ptr<const tgba_safra_complement>
|
typedef std::shared_ptr<const tgba_safra_complement>
|
||||||
const_tgba_safra_complement_ptr;
|
const_tgba_safra_complement_ptr;
|
||||||
inline tgba_safra_complement_ptr
|
inline tgba_safra_complement_ptr
|
||||||
make_safra_complement(const const_tgba_digraph_ptr& a)
|
make_safra_complement(const const_twa_graph_ptr& a)
|
||||||
{
|
{
|
||||||
return std::make_shared<tgba_safra_complement>(a);
|
return std::make_shared<tgba_safra_complement>(a);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
typedef spot::tgba_digraph::graph_t::trans_storage_t tr_t;
|
typedef spot::twa_graph::graph_t::trans_storage_t tr_t;
|
||||||
bool
|
bool
|
||||||
tr_t_less_than(const tr_t& t1, const tr_t& t2)
|
tr_t_less_than(const tr_t& t1, const tr_t& t2)
|
||||||
{
|
{
|
||||||
|
|
@ -43,8 +43,8 @@ namespace
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
are_isomorphic_det(const spot::const_tgba_digraph_ptr aut1,
|
are_isomorphic_det(const spot::const_twa_graph_ptr aut1,
|
||||||
const spot::const_tgba_digraph_ptr aut2)
|
const spot::const_twa_graph_ptr aut2)
|
||||||
{
|
{
|
||||||
typedef std::pair<unsigned, unsigned> state_pair_t;
|
typedef std::pair<unsigned, unsigned> state_pair_t;
|
||||||
std::queue<state_pair_t> workqueue;
|
std::queue<state_pair_t> workqueue;
|
||||||
|
|
@ -97,8 +97,8 @@ namespace
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
trivially_different(const spot::const_tgba_digraph_ptr aut1,
|
trivially_different(const spot::const_twa_graph_ptr aut1,
|
||||||
const spot::const_tgba_digraph_ptr aut2)
|
const spot::const_twa_graph_ptr aut2)
|
||||||
{
|
{
|
||||||
return aut1->num_states() != aut2->num_states() ||
|
return aut1->num_states() != aut2->num_states() ||
|
||||||
aut1->num_transitions() != aut2->num_transitions() ||
|
aut1->num_transitions() != aut2->num_transitions() ||
|
||||||
|
|
@ -110,9 +110,9 @@ namespace
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
isomorphism_checker::isomorphism_checker(const const_tgba_digraph_ptr ref)
|
isomorphism_checker::isomorphism_checker(const const_twa_graph_ptr ref)
|
||||||
{
|
{
|
||||||
ref_ = make_tgba_digraph(ref, twa::prop_set::all());
|
ref_ = make_twa_graph(ref, twa::prop_set::all());
|
||||||
ref_deterministic_ = ref_->is_deterministic();
|
ref_deterministic_ = ref_->is_deterministic();
|
||||||
if (!ref_deterministic_)
|
if (!ref_deterministic_)
|
||||||
{
|
{
|
||||||
|
|
@ -123,7 +123,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
isomorphism_checker::is_isomorphic(const const_tgba_digraph_ptr aut)
|
isomorphism_checker::is_isomorphic(const const_twa_graph_ptr aut)
|
||||||
{
|
{
|
||||||
if (trivially_different(ref_, aut))
|
if (trivially_different(ref_, aut))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -144,7 +144,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto tmp = make_tgba_digraph(aut, twa::prop_set::all());
|
auto tmp = make_twa_graph(aut, twa::prop_set::all());
|
||||||
spot::canonicalize(tmp);
|
spot::canonicalize(tmp);
|
||||||
return *tmp == *ref_;
|
return *tmp == *ref_;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ namespace spot
|
||||||
class SPOT_API isomorphism_checker
|
class SPOT_API isomorphism_checker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
isomorphism_checker(const const_tgba_digraph_ptr ref);
|
isomorphism_checker(const const_twa_graph_ptr ref);
|
||||||
|
|
||||||
/// \ingroup tgba_misc
|
/// \ingroup tgba_misc
|
||||||
/// \brief Check whether an automaton is isomorphic to the one passed to
|
/// \brief Check whether an automaton is isomorphic to the one passed to
|
||||||
|
|
@ -43,12 +43,12 @@ namespace spot
|
||||||
/// canonicalize(aut1) == canonicalize(aut2), but is_isomorphic can do some
|
/// canonicalize(aut1) == canonicalize(aut2), but is_isomorphic can do some
|
||||||
/// optimizations in some cases.
|
/// optimizations in some cases.
|
||||||
bool
|
bool
|
||||||
is_isomorphic(const const_tgba_digraph_ptr aut);
|
is_isomorphic(const const_twa_graph_ptr aut);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
tgba_digraph_ptr ref_;
|
twa_graph_ptr ref_;
|
||||||
bool ref_deterministic_ = false;
|
bool ref_deterministic_ = false;
|
||||||
unsigned nondet_states_ = 0;
|
unsigned nondet_states_ = 0;
|
||||||
std::vector<tgba_digraph::graph_t::trans_storage_t> reftrans_;
|
std::vector<twa_graph::graph_t::trans_storage_t> reftrans_;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
typedef std::pair<spot::tgba_digraph::graph_t::trans_data_t, unsigned>
|
typedef std::pair<spot::twa_graph::graph_t::trans_data_t, unsigned>
|
||||||
trans_sig_t;
|
trans_sig_t;
|
||||||
|
|
||||||
struct signature_t
|
struct signature_t
|
||||||
|
|
@ -45,7 +45,7 @@ namespace
|
||||||
typedef std::map<signature_t, std::vector<unsigned>> sig2states_t;
|
typedef std::map<signature_t, std::vector<unsigned>> sig2states_t;
|
||||||
|
|
||||||
static sig2states_t
|
static sig2states_t
|
||||||
sig_to_states(spot::tgba_digraph_ptr aut, std::vector<unsigned>& state2class)
|
sig_to_states(spot::twa_graph_ptr aut, std::vector<unsigned>& state2class)
|
||||||
{
|
{
|
||||||
std::vector<signature_t> signature(aut->num_states(), signature_t());
|
std::vector<signature_t> signature(aut->num_states(), signature_t());
|
||||||
|
|
||||||
|
|
@ -70,8 +70,8 @@ namespace
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
canonicalize(tgba_digraph_ptr aut)
|
canonicalize(twa_graph_ptr aut)
|
||||||
{
|
{
|
||||||
std::vector<unsigned> state2class(aut->num_states(), 0);
|
std::vector<unsigned> state2class(aut->num_states(), 0);
|
||||||
state2class[aut->get_init_state_number()] = 1;
|
state2class[aut->get_init_state_number()] = 1;
|
||||||
|
|
|
||||||
|
|
@ -26,5 +26,5 @@ namespace spot
|
||||||
/// \ingroup tgba_misc
|
/// \ingroup tgba_misc
|
||||||
/// \brief Reorder the states and transitions of aut in a way that will be the
|
/// \brief Reorder the states and transitions of aut in a way that will be the
|
||||||
/// same for every isomorphic automata.
|
/// same for every isomorphic automata.
|
||||||
SPOT_API tgba_digraph_ptr canonicalize(tgba_digraph_ptr aut);
|
SPOT_API twa_graph_ptr canonicalize(twa_graph_ptr aut);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
tgba_digraph_ptr cleanup_acceptance_here(tgba_digraph_ptr aut)
|
twa_graph_ptr cleanup_acceptance_here(twa_graph_ptr aut)
|
||||||
{
|
{
|
||||||
auto& acc = aut->acc();
|
auto& acc = aut->acc();
|
||||||
if (acc.num_sets() == 0)
|
if (acc.num_sets() == 0)
|
||||||
|
|
@ -53,9 +53,9 @@ namespace spot
|
||||||
return cleanup_acceptance_here(aut);
|
return cleanup_acceptance_here(aut);
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr cleanup_acceptance(const_tgba_digraph_ptr aut)
|
twa_graph_ptr cleanup_acceptance(const_twa_graph_ptr aut)
|
||||||
{
|
{
|
||||||
return cleanup_acceptance_here(make_tgba_digraph(aut,
|
return cleanup_acceptance_here(make_twa_graph(aut,
|
||||||
twa::prop_set::all()));
|
twa::prop_set::all()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,10 @@ namespace spot
|
||||||
{
|
{
|
||||||
/// \brief Remove useless acceptance sets
|
/// \brief Remove useless acceptance sets
|
||||||
/// @{
|
/// @{
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
cleanup_acceptance_here(tgba_digraph_ptr aut);
|
cleanup_acceptance_here(twa_graph_ptr aut);
|
||||||
|
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
cleanup_acceptance(const_tgba_digraph_ptr aut);
|
cleanup_acceptance(const_twa_graph_ptr aut);
|
||||||
/// @}
|
/// @}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
unsigned tgba_complete_here(tgba_digraph_ptr aut)
|
unsigned tgba_complete_here(twa_graph_ptr aut)
|
||||||
{
|
{
|
||||||
unsigned n = aut->num_states();
|
unsigned n = aut->num_states();
|
||||||
unsigned sink = -1U;
|
unsigned sink = -1U;
|
||||||
|
|
@ -117,9 +117,9 @@ namespace spot
|
||||||
return sink;
|
return sink;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr tgba_complete(const const_tgba_ptr& aut)
|
twa_graph_ptr tgba_complete(const const_tgba_ptr& aut)
|
||||||
{
|
{
|
||||||
auto res = make_tgba_digraph(aut, {
|
auto res = make_twa_graph(aut, {
|
||||||
true, // state based
|
true, // state based
|
||||||
true, // inherently_weak
|
true, // inherently_weak
|
||||||
true, // deterministic
|
true, // deterministic
|
||||||
|
|
|
||||||
|
|
@ -23,17 +23,17 @@
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
/// \brief Complete a tgba_digraph in place.
|
/// \brief Complete a twa_graph in place.
|
||||||
///
|
///
|
||||||
/// If the tgba has no acceptance set, one will be added. The
|
/// If the tgba has no acceptance set, one will be added. The
|
||||||
/// returned value is the number of the sink state (it can be a new
|
/// returned value is the number of the sink state (it can be a new
|
||||||
/// state added for completion, or an existing non-accepting state
|
/// state added for completion, or an existing non-accepting state
|
||||||
/// that has been reused as sink state because it had not outgoing
|
/// that has been reused as sink state because it had not outgoing
|
||||||
/// transitions apart from self-loops.)
|
/// transitions apart from self-loops.)
|
||||||
SPOT_API unsigned tgba_complete_here(tgba_digraph_ptr aut);
|
SPOT_API unsigned tgba_complete_here(twa_graph_ptr aut);
|
||||||
|
|
||||||
/// \brief Clone a tgba and complete it.
|
/// \brief Clone a tgba and complete it.
|
||||||
///
|
///
|
||||||
/// If the tgba has no acceptance set, one will be added.
|
/// If the tgba has no acceptance set, one will be added.
|
||||||
SPOT_API tgba_digraph_ptr tgba_complete(const const_tgba_ptr& aut);
|
SPOT_API twa_graph_ptr tgba_complete(const const_tgba_ptr& aut);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@ namespace spot
|
||||||
typedef std::deque<state_pair> pair_queue;
|
typedef std::deque<state_pair> pair_queue;
|
||||||
|
|
||||||
static
|
static
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
susp_prod(const const_tgba_ptr& left, const ltl::formula* f, bdd v)
|
susp_prod(const const_tgba_ptr& left, const ltl::formula* f, bdd v)
|
||||||
{
|
{
|
||||||
bdd_dict_ptr dict = left->get_dict();
|
bdd_dict_ptr dict = left->get_dict();
|
||||||
|
|
@ -219,7 +219,7 @@ namespace spot
|
||||||
iterated_simulations(scc_filter(ltl_to_tgba_fm(f, dict, true, true),
|
iterated_simulations(scc_filter(ltl_to_tgba_fm(f, dict, true, true),
|
||||||
false));
|
false));
|
||||||
|
|
||||||
tgba_digraph_ptr res = make_tgba_digraph(dict);
|
twa_graph_ptr res = make_twa_graph(dict);
|
||||||
dict->register_all_variables_of(left, res);
|
dict->register_all_variables_of(left, res);
|
||||||
dict->register_all_variables_of(right, res);
|
dict->register_all_variables_of(right, res);
|
||||||
dict->unregister_variable(bdd_var(v), res);
|
dict->unregister_variable(bdd_var(v), res);
|
||||||
|
|
@ -321,7 +321,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
compsusp(const ltl::formula* f, const bdd_dict_ptr& dict,
|
compsusp(const ltl::formula* f, const bdd_dict_ptr& dict,
|
||||||
bool no_wdba, bool no_simulation,
|
bool no_wdba, bool no_simulation,
|
||||||
bool early_susp, bool no_susp_product, bool wdba_smaller,
|
bool early_susp, bool no_susp_product, bool wdba_smaller,
|
||||||
|
|
@ -333,13 +333,13 @@ namespace spot
|
||||||
const ltl::formula* g = v.recurse(f);
|
const ltl::formula* g = v.recurse(f);
|
||||||
|
|
||||||
// Translate the patched formula, and remove useless SCCs.
|
// Translate the patched formula, and remove useless SCCs.
|
||||||
tgba_digraph_ptr res =
|
twa_graph_ptr res =
|
||||||
scc_filter(ltl_to_tgba_fm(g, dict, true, true, false, false, 0, 0),
|
scc_filter(ltl_to_tgba_fm(g, dict, true, true, false, false, 0, 0),
|
||||||
false);
|
false);
|
||||||
|
|
||||||
if (!no_wdba)
|
if (!no_wdba)
|
||||||
{
|
{
|
||||||
tgba_digraph_ptr min = minimize_obligation(res, g, 0, wdba_smaller);
|
twa_graph_ptr min = minimize_obligation(res, g, 0, wdba_smaller);
|
||||||
if (min != res)
|
if (min != res)
|
||||||
{
|
{
|
||||||
res = min;
|
res = min;
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ namespace spot
|
||||||
/// This interface is subject to change, and clients aiming for
|
/// This interface is subject to change, and clients aiming for
|
||||||
/// long-term stability should better use the services of the
|
/// long-term stability should better use the services of the
|
||||||
/// spot::translator class instead.
|
/// spot::translator class instead.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
compsusp(const ltl::formula* f, const bdd_dict_ptr& dict,
|
compsusp(const ltl::formula* f, const bdd_dict_ptr& dict,
|
||||||
bool no_wdba = false, bool no_simulation = false,
|
bool no_wdba = false, bool no_simulation = false,
|
||||||
bool early_susp = false, bool no_susp_product = false,
|
bool early_susp = false, bool no_susp_product = false,
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ namespace spot
|
||||||
};
|
};
|
||||||
|
|
||||||
// The automaton we are working on.
|
// The automaton we are working on.
|
||||||
const_tgba_digraph_ptr aut_;
|
const_twa_graph_ptr aut_;
|
||||||
// Store the state_info for all visited states.
|
// Store the state_info for all visited states.
|
||||||
std::vector<state_info> info_;
|
std::vector<state_info> info_;
|
||||||
// The SCC map built for aut_.
|
// The SCC map built for aut_.
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ namespace spot
|
||||||
// SCC -- we do not care about the other) of some state.
|
// SCC -- we do not care about the other) of some state.
|
||||||
class outgoing_acc
|
class outgoing_acc
|
||||||
{
|
{
|
||||||
const_tgba_digraph_ptr a_;
|
const_twa_graph_ptr a_;
|
||||||
typedef std::tuple<acc_cond::mark_t,
|
typedef std::tuple<acc_cond::mark_t,
|
||||||
acc_cond::mark_t,
|
acc_cond::mark_t,
|
||||||
bool> cache_entry;
|
bool> cache_entry;
|
||||||
|
|
@ -94,7 +94,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
outgoing_acc(const const_tgba_digraph_ptr& a, const scc_info* sm):
|
outgoing_acc(const const_twa_graph_ptr& a, const scc_info* sm):
|
||||||
a_(a), cache_(a->num_states()), sm_(sm)
|
a_(a), cache_(a->num_states()), sm_(sm)
|
||||||
{
|
{
|
||||||
unsigned n = a->num_states();
|
unsigned n = a->num_states();
|
||||||
|
|
@ -189,8 +189,8 @@ namespace spot
|
||||||
};
|
};
|
||||||
|
|
||||||
template<bool want_sba>
|
template<bool want_sba>
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
degeneralize_aux(const const_tgba_digraph_ptr& a, bool use_z_lvl,
|
degeneralize_aux(const const_twa_graph_ptr& a, bool use_z_lvl,
|
||||||
bool use_cust_acc_orders, int use_lvl_cache,
|
bool use_cust_acc_orders, int use_lvl_cache,
|
||||||
bool skip_levels, bool ignaccsl)
|
bool skip_levels, bool ignaccsl)
|
||||||
{
|
{
|
||||||
|
|
@ -203,7 +203,7 @@ namespace spot
|
||||||
bdd_dict_ptr dict = a->get_dict();
|
bdd_dict_ptr dict = a->get_dict();
|
||||||
|
|
||||||
// The result automaton is an SBA.
|
// The result automaton is an SBA.
|
||||||
auto res = make_tgba_digraph(dict);
|
auto res = make_twa_graph(dict);
|
||||||
res->copy_ap_of(a);
|
res->copy_ap_of(a);
|
||||||
res->set_buchi();
|
res->set_buchi();
|
||||||
if (want_sba)
|
if (want_sba)
|
||||||
|
|
@ -551,29 +551,29 @@ namespace spot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
degeneralize(const const_tgba_digraph_ptr& a,
|
degeneralize(const const_twa_graph_ptr& a,
|
||||||
bool use_z_lvl, bool use_cust_acc_orders,
|
bool use_z_lvl, bool use_cust_acc_orders,
|
||||||
int use_lvl_cache, bool skip_levels, bool ignaccsl)
|
int use_lvl_cache, bool skip_levels, bool ignaccsl)
|
||||||
{
|
{
|
||||||
// If this already a degeneralized digraph, there is nothing we
|
// If this already a degeneralized digraph, there is nothing we
|
||||||
// can improve.
|
// can improve.
|
||||||
if (a->is_sba())
|
if (a->is_sba())
|
||||||
return std::const_pointer_cast<tgba_digraph>(a);
|
return std::const_pointer_cast<twa_graph>(a);
|
||||||
|
|
||||||
return degeneralize_aux<true>(a, use_z_lvl, use_cust_acc_orders,
|
return degeneralize_aux<true>(a, use_z_lvl, use_cust_acc_orders,
|
||||||
use_lvl_cache, skip_levels, ignaccsl);
|
use_lvl_cache, skip_levels, ignaccsl);
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
degeneralize_tba(const const_tgba_digraph_ptr& a,
|
degeneralize_tba(const const_twa_graph_ptr& a,
|
||||||
bool use_z_lvl, bool use_cust_acc_orders,
|
bool use_z_lvl, bool use_cust_acc_orders,
|
||||||
int use_lvl_cache, bool skip_levels, bool ignaccsl)
|
int use_lvl_cache, bool skip_levels, bool ignaccsl)
|
||||||
{
|
{
|
||||||
// If this already a degeneralized digraph, there is nothing we
|
// If this already a degeneralized digraph, there is nothing we
|
||||||
// can improve.
|
// can improve.
|
||||||
if (a->acc().is_buchi())
|
if (a->acc().is_buchi())
|
||||||
return std::const_pointer_cast<tgba_digraph>(a);
|
return std::const_pointer_cast<twa_graph>(a);
|
||||||
|
|
||||||
return degeneralize_aux<false>(a, use_z_lvl, use_cust_acc_orders,
|
return degeneralize_aux<false>(a, use_z_lvl, use_cust_acc_orders,
|
||||||
use_lvl_cache, skip_levels, ignaccsl);
|
use_lvl_cache, skip_levels, ignaccsl);
|
||||||
|
|
|
||||||
|
|
@ -49,15 +49,15 @@ namespace spot
|
||||||
/// The degeneralize_tba() variant produce a degeneralized automaton
|
/// The degeneralize_tba() variant produce a degeneralized automaton
|
||||||
/// with transition-based acceptance.
|
/// with transition-based acceptance.
|
||||||
/// \@{
|
/// \@{
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
degeneralize(const const_tgba_digraph_ptr& a, bool use_z_lvl = true,
|
degeneralize(const const_twa_graph_ptr& a, bool use_z_lvl = true,
|
||||||
bool use_cust_acc_orders = false,
|
bool use_cust_acc_orders = false,
|
||||||
int use_lvl_cache = 1,
|
int use_lvl_cache = 1,
|
||||||
bool skip_levels = true,
|
bool skip_levels = true,
|
||||||
bool ignaccsl = false);
|
bool ignaccsl = false);
|
||||||
|
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
degeneralize_tba(const const_tgba_digraph_ptr& a, bool use_z_lvl = true,
|
degeneralize_tba(const const_twa_graph_ptr& a, bool use_z_lvl = true,
|
||||||
bool use_cust_acc_orders = false,
|
bool use_cust_acc_orders = false,
|
||||||
int use_lvl_cache = 1,
|
int use_lvl_cache = 1,
|
||||||
bool skip_levels = true,
|
bool skip_levels = true,
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ namespace spot
|
||||||
bool mark_states_ = false;
|
bool mark_states_ = false;
|
||||||
bool opt_scc_ = false;
|
bool opt_scc_ = false;
|
||||||
bool opt_html_labels_ = false;
|
bool opt_html_labels_ = false;
|
||||||
const_tgba_digraph_ptr aut_;
|
const_twa_graph_ptr aut_;
|
||||||
std::vector<std::string>* sn_;
|
std::vector<std::string>* sn_;
|
||||||
std::string* name_ = nullptr;
|
std::string* name_ = nullptr;
|
||||||
acc_cond::mark_t inf_sets_ = 0U;
|
acc_cond::mark_t inf_sets_ = 0U;
|
||||||
|
|
@ -400,7 +400,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
process_link(const tgba_digraph::trans_storage_t& t, int number)
|
process_link(const twa_graph::trans_storage_t& t, int number)
|
||||||
{
|
{
|
||||||
std::string label = bdd_format_formula(aut_->get_dict(), t.cond);
|
std::string label = bdd_format_formula(aut_->get_dict(), t.cond);
|
||||||
os_ << " " << t.src << " -> " << t.dst;
|
os_ << " " << t.src << " -> " << t.dst;
|
||||||
|
|
@ -433,7 +433,7 @@ namespace spot
|
||||||
os_ << "]\n";
|
os_ << "]\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void print(const const_tgba_digraph_ptr& aut)
|
void print(const const_twa_graph_ptr& aut)
|
||||||
{
|
{
|
||||||
aut_ = aut;
|
aut_ = aut;
|
||||||
sn_ = aut->get_named_prop<std::vector<std::string>>("state-names");
|
sn_ = aut->get_named_prop<std::vector<std::string>>("state-names");
|
||||||
|
|
@ -492,9 +492,9 @@ namespace spot
|
||||||
const char* options)
|
const char* options)
|
||||||
{
|
{
|
||||||
dotty_output d(os, options);
|
dotty_output d(os, options);
|
||||||
auto aut = std::dynamic_pointer_cast<const tgba_digraph>(g);
|
auto aut = std::dynamic_pointer_cast<const twa_graph>(g);
|
||||||
if (!aut)
|
if (!aut)
|
||||||
aut = make_tgba_digraph(g, twa::prop_set::all());
|
aut = make_twa_graph(g, twa::prop_set::all());
|
||||||
d.print(aut);
|
d.print(aut);
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -214,7 +214,7 @@ namespace spot
|
||||||
unsigned cand_size;
|
unsigned cand_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned declare_vars(const const_tgba_digraph_ptr& aut,
|
unsigned declare_vars(const const_twa_graph_ptr& aut,
|
||||||
dict& d,
|
dict& d,
|
||||||
bdd ap,
|
bdd ap,
|
||||||
bool state_based,
|
bool state_based,
|
||||||
|
|
@ -295,7 +295,7 @@ namespace spot
|
||||||
|
|
||||||
static
|
static
|
||||||
sat_stats dtba_to_sat(std::ostream& out,
|
sat_stats dtba_to_sat(std::ostream& out,
|
||||||
const const_tgba_digraph_ptr& ref,
|
const const_twa_graph_ptr& ref,
|
||||||
dict& d, bool state_based)
|
dict& d, bool state_based)
|
||||||
{
|
{
|
||||||
clause_counter nclauses;
|
clause_counter nclauses;
|
||||||
|
|
@ -631,12 +631,12 @@ namespace spot
|
||||||
return std::make_pair(d.nvars, nclauses.nb_clauses());
|
return std::make_pair(d.nvars, nclauses.nb_clauses());
|
||||||
}
|
}
|
||||||
|
|
||||||
static tgba_digraph_ptr
|
static twa_graph_ptr
|
||||||
sat_build(const satsolver::solution& solution, dict& satdict,
|
sat_build(const satsolver::solution& solution, dict& satdict,
|
||||||
const_tgba_digraph_ptr aut, bool state_based)
|
const_twa_graph_ptr aut, bool state_based)
|
||||||
{
|
{
|
||||||
auto autdict = aut->get_dict();
|
auto autdict = aut->get_dict();
|
||||||
auto a = make_tgba_digraph(autdict);
|
auto a = make_twa_graph(autdict);
|
||||||
a->copy_ap_of(aut);
|
a->copy_ap_of(aut);
|
||||||
acc_cond::mark_t acc = a->set_buchi();
|
acc_cond::mark_t acc = a->set_buchi();
|
||||||
if (state_based)
|
if (state_based)
|
||||||
|
|
@ -737,8 +737,8 @@ namespace spot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
dtba_sat_synthetize(const const_tgba_digraph_ptr& a,
|
dtba_sat_synthetize(const const_twa_graph_ptr& a,
|
||||||
int target_state_number, bool state_based)
|
int target_state_number, bool state_based)
|
||||||
{
|
{
|
||||||
if (!a->acc().is_buchi())
|
if (!a->acc().is_buchi())
|
||||||
|
|
@ -762,7 +762,7 @@ namespace spot
|
||||||
solution = solver.get_solution();
|
solution = solver.get_solution();
|
||||||
t.stop("solve");
|
t.stop("solve");
|
||||||
|
|
||||||
tgba_digraph_ptr res = nullptr;
|
twa_graph_ptr res = nullptr;
|
||||||
if (!solution.second.empty())
|
if (!solution.second.empty())
|
||||||
res = sat_build(solution.second, d, a, state_based);
|
res = sat_build(solution.second, d, a, state_based);
|
||||||
|
|
||||||
|
|
@ -805,12 +805,12 @@ namespace spot
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
dtba_sat_minimize(const const_tgba_digraph_ptr& a, bool state_based)
|
dtba_sat_minimize(const const_twa_graph_ptr& a, bool state_based)
|
||||||
{
|
{
|
||||||
int n_states = stats_reachable(a).states;
|
int n_states = stats_reachable(a).states;
|
||||||
|
|
||||||
tgba_digraph_ptr prev = nullptr;
|
twa_graph_ptr prev = nullptr;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
auto next =
|
auto next =
|
||||||
|
|
@ -824,14 +824,14 @@ namespace spot
|
||||||
SPOT_UNREACHABLE();
|
SPOT_UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
dtba_sat_minimize_dichotomy(const const_tgba_digraph_ptr& a,
|
dtba_sat_minimize_dichotomy(const const_twa_graph_ptr& a,
|
||||||
bool state_based)
|
bool state_based)
|
||||||
{
|
{
|
||||||
int max_states = stats_reachable(a).states - 1;
|
int max_states = stats_reachable(a).states - 1;
|
||||||
int min_states = 1;
|
int min_states = 1;
|
||||||
|
|
||||||
tgba_digraph_ptr prev = nullptr;
|
twa_graph_ptr prev = nullptr;
|
||||||
while (min_states <= max_states)
|
while (min_states <= max_states)
|
||||||
{
|
{
|
||||||
int target = (max_states + min_states) / 2;
|
int target = (max_states + min_states) / 2;
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,8 @@ namespace spot
|
||||||
///
|
///
|
||||||
/// If no equivalent deterministic TBA with \a target_state_number
|
/// If no equivalent deterministic TBA with \a target_state_number
|
||||||
/// states is found, a null pointer
|
/// states is found, a null pointer
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
dtba_sat_synthetize(const const_tgba_digraph_ptr& a,
|
dtba_sat_synthetize(const const_twa_graph_ptr& a,
|
||||||
int target_state_number,
|
int target_state_number,
|
||||||
bool state_based = false);
|
bool state_based = false);
|
||||||
|
|
||||||
|
|
@ -50,8 +50,8 @@ namespace spot
|
||||||
/// number of states, and returns the last successfully built TBA.
|
/// number of states, and returns the last successfully built TBA.
|
||||||
///
|
///
|
||||||
/// If no smaller TBA exist, this returns a null pointer.
|
/// If no smaller TBA exist, this returns a null pointer.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
dtba_sat_minimize(const const_tgba_digraph_ptr& a,
|
dtba_sat_minimize(const const_twa_graph_ptr& a,
|
||||||
bool state_based = false);
|
bool state_based = false);
|
||||||
|
|
||||||
/// \brief Attempt to minimize a deterministic TBA with a SAT solver.
|
/// \brief Attempt to minimize a deterministic TBA with a SAT solver.
|
||||||
|
|
@ -60,7 +60,7 @@ namespace spot
|
||||||
/// find the minimum number of states using a binary search.
|
/// find the minimum number of states using a binary search.
|
||||||
//
|
//
|
||||||
/// If no smaller TBA exist, this returns a null pointer.
|
/// If no smaller TBA exist, this returns a null pointer.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
dtba_sat_minimize_dichotomy(const const_tgba_digraph_ptr& a,
|
dtba_sat_minimize_dichotomy(const const_twa_graph_ptr& a,
|
||||||
bool state_based = false);
|
bool state_based = false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,10 @@
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
tgba_digraph_ptr dtgba_complement_nonweak(const const_tgba_digraph_ptr& aut)
|
twa_graph_ptr dtgba_complement_nonweak(const const_twa_graph_ptr& aut)
|
||||||
{
|
{
|
||||||
// Clone the original automaton.
|
// Clone the original automaton.
|
||||||
auto res = make_tgba_digraph(aut,
|
auto res = make_twa_graph(aut,
|
||||||
{ false, // state based
|
{ false, // state based
|
||||||
false, // inherently_weak
|
false, // inherently_weak
|
||||||
false, // deterministic
|
false, // deterministic
|
||||||
|
|
@ -112,10 +112,10 @@ namespace spot
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr dtgba_complement_weak(const const_tgba_digraph_ptr& aut)
|
twa_graph_ptr dtgba_complement_weak(const const_twa_graph_ptr& aut)
|
||||||
{
|
{
|
||||||
// Clone the original automaton.
|
// Clone the original automaton.
|
||||||
auto res = make_tgba_digraph(aut,
|
auto res = make_twa_graph(aut,
|
||||||
{ true, // state based
|
{ true, // state based
|
||||||
true, // inherently weak
|
true, // inherently weak
|
||||||
true, // determinisitic
|
true, // determinisitic
|
||||||
|
|
@ -160,7 +160,7 @@ namespace spot
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr dtgba_complement(const const_tgba_digraph_ptr& aut)
|
twa_graph_ptr dtgba_complement(const const_twa_graph_ptr& aut)
|
||||||
{
|
{
|
||||||
if (aut->acc().is_generalized_buchi())
|
if (aut->acc().is_generalized_buchi())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,6 @@ namespace spot
|
||||||
/// state-based. Unless the input automaton is marked as weak (in
|
/// state-based. Unless the input automaton is marked as weak (in
|
||||||
/// which case the output will also be weak and deterministic) the
|
/// which case the output will also be weak and deterministic) the
|
||||||
/// resulting automaton is very unlikely to be deterministic.
|
/// resulting automaton is very unlikely to be deterministic.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
dtgba_complement(const const_tgba_digraph_ptr& aut);
|
dtgba_complement(const const_twa_graph_ptr& aut);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -285,7 +285,7 @@ namespace spot
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
unsigned declare_vars(const const_tgba_digraph_ptr& aut,
|
unsigned declare_vars(const const_twa_graph_ptr& aut,
|
||||||
dict& d, bdd ap, bool state_based, scc_info& sm)
|
dict& d, bdd ap, bool state_based, scc_info& sm)
|
||||||
{
|
{
|
||||||
bdd_dict_ptr bd = aut->get_dict();
|
bdd_dict_ptr bd = aut->get_dict();
|
||||||
|
|
@ -424,7 +424,7 @@ namespace spot
|
||||||
typedef std::pair<int, int> sat_stats;
|
typedef std::pair<int, int> sat_stats;
|
||||||
|
|
||||||
static
|
static
|
||||||
sat_stats dtgba_to_sat(std::ostream& out, const_tgba_digraph_ptr ref,
|
sat_stats dtgba_to_sat(std::ostream& out, const_twa_graph_ptr ref,
|
||||||
dict& d, bool state_based)
|
dict& d, bool state_based)
|
||||||
{
|
{
|
||||||
clause_counter nclauses;
|
clause_counter nclauses;
|
||||||
|
|
@ -772,12 +772,12 @@ namespace spot
|
||||||
return std::make_pair(d.nvars, nclauses.nb_clauses());
|
return std::make_pair(d.nvars, nclauses.nb_clauses());
|
||||||
}
|
}
|
||||||
|
|
||||||
static tgba_digraph_ptr
|
static twa_graph_ptr
|
||||||
sat_build(const satsolver::solution& solution, dict& satdict,
|
sat_build(const satsolver::solution& solution, dict& satdict,
|
||||||
const_tgba_digraph_ptr aut, bool state_based)
|
const_twa_graph_ptr aut, bool state_based)
|
||||||
{
|
{
|
||||||
auto autdict = aut->get_dict();
|
auto autdict = aut->get_dict();
|
||||||
auto a = make_tgba_digraph(autdict);
|
auto a = make_twa_graph(autdict);
|
||||||
a->copy_ap_of(aut);
|
a->copy_ap_of(aut);
|
||||||
a->set_generalized_buchi(satdict.cand_nacc);
|
a->set_generalized_buchi(satdict.cand_nacc);
|
||||||
if (state_based)
|
if (state_based)
|
||||||
|
|
@ -873,8 +873,8 @@ namespace spot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
dtgba_sat_synthetize(const const_tgba_digraph_ptr& a,
|
dtgba_sat_synthetize(const const_twa_graph_ptr& a,
|
||||||
unsigned target_acc_number,
|
unsigned target_acc_number,
|
||||||
int target_state_number, bool state_based)
|
int target_state_number, bool state_based)
|
||||||
{
|
{
|
||||||
|
|
@ -902,7 +902,7 @@ namespace spot
|
||||||
solution = solver.get_solution();
|
solution = solver.get_solution();
|
||||||
t.stop("solve");
|
t.stop("solve");
|
||||||
|
|
||||||
tgba_digraph_ptr res = nullptr;
|
twa_graph_ptr res = nullptr;
|
||||||
if (!solution.second.empty())
|
if (!solution.second.empty())
|
||||||
res = sat_build(solution.second, d, a, state_based);
|
res = sat_build(solution.second, d, a, state_based);
|
||||||
|
|
||||||
|
|
@ -945,14 +945,14 @@ namespace spot
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
dtgba_sat_minimize(const const_tgba_digraph_ptr& a,
|
dtgba_sat_minimize(const const_twa_graph_ptr& a,
|
||||||
unsigned target_acc_number,
|
unsigned target_acc_number,
|
||||||
bool state_based)
|
bool state_based)
|
||||||
{
|
{
|
||||||
int n_states = stats_reachable(a).states;
|
int n_states = stats_reachable(a).states;
|
||||||
|
|
||||||
tgba_digraph_ptr prev = nullptr;
|
twa_graph_ptr prev = nullptr;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
auto next =
|
auto next =
|
||||||
|
|
@ -967,15 +967,15 @@ namespace spot
|
||||||
SPOT_UNREACHABLE();
|
SPOT_UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
dtgba_sat_minimize_dichotomy(const const_tgba_digraph_ptr& a,
|
dtgba_sat_minimize_dichotomy(const const_twa_graph_ptr& a,
|
||||||
unsigned target_acc_number,
|
unsigned target_acc_number,
|
||||||
bool state_based)
|
bool state_based)
|
||||||
{
|
{
|
||||||
int max_states = stats_reachable(a).states - 1;
|
int max_states = stats_reachable(a).states - 1;
|
||||||
int min_states = 1;
|
int min_states = 1;
|
||||||
|
|
||||||
tgba_digraph_ptr prev = nullptr;
|
twa_graph_ptr prev = nullptr;
|
||||||
while (min_states <= max_states)
|
while (min_states <= max_states)
|
||||||
{
|
{
|
||||||
int target = (max_states + min_states) / 2;
|
int target = (max_states + min_states) / 2;
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,8 @@ namespace spot
|
||||||
/// acceptance sets and target_state_number states that is
|
/// acceptance sets and target_state_number states that is
|
||||||
/// equivalent to \a a. If no such TGBA is found, a null pointer is
|
/// equivalent to \a a. If no such TGBA is found, a null pointer is
|
||||||
/// returned.
|
/// returned.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
dtgba_sat_synthetize(const const_tgba_digraph_ptr& a,
|
dtgba_sat_synthetize(const const_twa_graph_ptr& a,
|
||||||
unsigned target_acc_number,
|
unsigned target_acc_number,
|
||||||
int target_state_number,
|
int target_state_number,
|
||||||
bool state_based = false);
|
bool state_based = false);
|
||||||
|
|
@ -55,8 +55,8 @@ namespace spot
|
||||||
/// number of states, and returns the last successfully built TGBA.
|
/// number of states, and returns the last successfully built TGBA.
|
||||||
///
|
///
|
||||||
/// If no smaller TGBA exist, this returns a null pointer.
|
/// If no smaller TGBA exist, this returns a null pointer.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
dtgba_sat_minimize(const const_tgba_digraph_ptr& a,
|
dtgba_sat_minimize(const const_twa_graph_ptr& a,
|
||||||
unsigned target_acc_number,
|
unsigned target_acc_number,
|
||||||
bool state_based = false);
|
bool state_based = false);
|
||||||
|
|
||||||
|
|
@ -66,8 +66,8 @@ namespace spot
|
||||||
/// find the minimum number of states using a binary search.
|
/// find the minimum number of states using a binary search.
|
||||||
//
|
//
|
||||||
/// If no smaller TBA exist, this returns a null pointer.
|
/// If no smaller TBA exist, this returns a null pointer.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
dtgba_sat_minimize_dichotomy(const const_tgba_digraph_ptr& a,
|
dtgba_sat_minimize_dichotomy(const const_twa_graph_ptr& a,
|
||||||
unsigned target_acc_number,
|
unsigned target_acc_number,
|
||||||
bool state_based = false);
|
bool state_based = false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,14 +37,14 @@ namespace spot
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
dupexp_iter(const const_tgba_ptr& a, twa::prop_set p)
|
dupexp_iter(const const_tgba_ptr& a, twa::prop_set p)
|
||||||
: T(a), out_(make_tgba_digraph(a->get_dict()))
|
: T(a), out_(make_twa_graph(a->get_dict()))
|
||||||
{
|
{
|
||||||
out_->copy_acceptance_of(a);
|
out_->copy_acceptance_of(a);
|
||||||
out_->copy_ap_of(a);
|
out_->copy_ap_of(a);
|
||||||
out_->prop_copy(a, p);
|
out_->prop_copy(a, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
result()
|
result()
|
||||||
{
|
{
|
||||||
return out_;
|
return out_;
|
||||||
|
|
@ -70,12 +70,12 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
tgba_digraph_ptr out_;
|
twa_graph_ptr out_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // anonymous
|
} // anonymous
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
tgba_dupexp_bfs(const const_tgba_ptr& aut, twa::prop_set p)
|
tgba_dupexp_bfs(const const_tgba_ptr& aut, twa::prop_set p)
|
||||||
{
|
{
|
||||||
dupexp_iter<tgba_reachable_iterator_breadth_first> di(aut, p);
|
dupexp_iter<tgba_reachable_iterator_breadth_first> di(aut, p);
|
||||||
|
|
@ -83,7 +83,7 @@ namespace spot
|
||||||
return di.result();
|
return di.result();
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
tgba_dupexp_dfs(const const_tgba_ptr& aut, twa::prop_set p)
|
tgba_dupexp_dfs(const const_tgba_ptr& aut, twa::prop_set p)
|
||||||
{
|
{
|
||||||
dupexp_iter<tgba_reachable_iterator_depth_first> di(aut, p);
|
dupexp_iter<tgba_reachable_iterator_depth_first> di(aut, p);
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,11 @@ namespace spot
|
||||||
/// \ingroup tgba_misc
|
/// \ingroup tgba_misc
|
||||||
/// \brief Build an explicit automaton from all states of \a aut,
|
/// \brief Build an explicit automaton from all states of \a aut,
|
||||||
/// numbering states in bread first order as they are processed.
|
/// numbering states in bread first order as they are processed.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
tgba_dupexp_bfs(const const_tgba_ptr& aut, twa::prop_set p);
|
tgba_dupexp_bfs(const const_tgba_ptr& aut, twa::prop_set p);
|
||||||
/// \ingroup tgba_misc
|
/// \ingroup tgba_misc
|
||||||
/// \brief Build an explicit automaton from all states of \a aut,
|
/// \brief Build an explicit automaton from all states of \a aut,
|
||||||
/// numbering states in depth first order as they are processed.
|
/// numbering states in depth first order as they are processed.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
tgba_dupexp_dfs(const const_tgba_ptr& aut, twa::prop_set p);
|
tgba_dupexp_dfs(const const_tgba_ptr& aut, twa::prop_set p);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -290,11 +290,11 @@ namespace spot
|
||||||
// tgba_run_to_tgba
|
// tgba_run_to_tgba
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
tgba_run_to_tgba(const const_tgba_ptr& a, const const_tgba_run_ptr& run)
|
tgba_run_to_tgba(const const_tgba_ptr& a, const const_tgba_run_ptr& run)
|
||||||
{
|
{
|
||||||
auto d = a->get_dict();
|
auto d = a->get_dict();
|
||||||
auto res = make_tgba_digraph(d);
|
auto res = make_twa_graph(d);
|
||||||
res->copy_ap_of(a);
|
res->copy_ap_of(a);
|
||||||
res->copy_acceptance_of(a);
|
res->copy_acceptance_of(a);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -315,7 +315,7 @@ namespace spot
|
||||||
/// states are merged).
|
/// states are merged).
|
||||||
///
|
///
|
||||||
/// \pre \a run must correspond to an actual run of the automaton \a a.
|
/// \pre \a run must correspond to an actual run of the automaton \a a.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
tgba_run_to_tgba(const const_tgba_ptr& a, const const_tgba_run_ptr& run);
|
tgba_run_to_tgba(const const_tgba_ptr& a, const const_tgba_run_ptr& run);
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ namespace spot
|
||||||
typedef std::map<bdd, std::string, bdd_less_than> sup_map;
|
typedef std::map<bdd, std::string, bdd_less_than> sup_map;
|
||||||
sup_map sup;
|
sup_map sup;
|
||||||
|
|
||||||
metadata(const const_tgba_digraph_ptr& aut, bool implicit)
|
metadata(const const_twa_graph_ptr& aut, bool implicit)
|
||||||
{
|
{
|
||||||
check_det_and_comp(aut);
|
check_det_and_comp(aut);
|
||||||
use_implicit_labels = implicit && is_deterministic && is_complete;
|
use_implicit_labels = implicit && is_deterministic && is_complete;
|
||||||
|
|
@ -67,7 +67,7 @@ namespace spot
|
||||||
|
|
||||||
std::ostream&
|
std::ostream&
|
||||||
emit_acc(std::ostream& os,
|
emit_acc(std::ostream& os,
|
||||||
const const_tgba_digraph_ptr& aut,
|
const const_twa_graph_ptr& aut,
|
||||||
acc_cond::mark_t b)
|
acc_cond::mark_t b)
|
||||||
{
|
{
|
||||||
// FIXME: We could use a cache for this.
|
// FIXME: We could use a cache for this.
|
||||||
|
|
@ -87,7 +87,7 @@ namespace spot
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
void check_det_and_comp(const const_tgba_digraph_ptr& aut)
|
void check_det_and_comp(const const_twa_graph_ptr& aut)
|
||||||
{
|
{
|
||||||
std::string empty;
|
std::string empty;
|
||||||
|
|
||||||
|
|
@ -223,7 +223,7 @@ namespace spot
|
||||||
|
|
||||||
static std::ostream&
|
static std::ostream&
|
||||||
hoa_reachable(std::ostream& os,
|
hoa_reachable(std::ostream& os,
|
||||||
const const_tgba_digraph_ptr& aut,
|
const const_twa_graph_ptr& aut,
|
||||||
const char* opt)
|
const char* opt)
|
||||||
{
|
{
|
||||||
bool newline = true;
|
bool newline = true;
|
||||||
|
|
@ -436,9 +436,9 @@ namespace spot
|
||||||
const char* opt)
|
const char* opt)
|
||||||
{
|
{
|
||||||
|
|
||||||
auto a = std::dynamic_pointer_cast<const tgba_digraph>(aut);
|
auto a = std::dynamic_pointer_cast<const twa_graph>(aut);
|
||||||
if (!a)
|
if (!a)
|
||||||
a = make_tgba_digraph(aut, twa::prop_set::all());
|
a = make_twa_graph(aut, twa::prop_set::all());
|
||||||
|
|
||||||
return hoa_reachable(os, a, opt);
|
return hoa_reachable(os, a, opt);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ namespace spot
|
||||||
template<bool count>
|
template<bool count>
|
||||||
static
|
static
|
||||||
unsigned
|
unsigned
|
||||||
count_nondet_states_aux(const const_tgba_digraph_ptr& aut)
|
count_nondet_states_aux(const const_twa_graph_ptr& aut)
|
||||||
{
|
{
|
||||||
unsigned nondet_states = 0;
|
unsigned nondet_states = 0;
|
||||||
unsigned ns = aut->num_states();
|
unsigned ns = aut->num_states();
|
||||||
|
|
@ -55,13 +55,13 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned
|
unsigned
|
||||||
count_nondet_states(const const_tgba_digraph_ptr& aut)
|
count_nondet_states(const const_twa_graph_ptr& aut)
|
||||||
{
|
{
|
||||||
return count_nondet_states_aux<true>(aut);
|
return count_nondet_states_aux<true>(aut);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
is_deterministic(const const_tgba_digraph_ptr& aut)
|
is_deterministic(const const_twa_graph_ptr& aut)
|
||||||
{
|
{
|
||||||
if (aut->is_deterministic())
|
if (aut->is_deterministic())
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -69,7 +69,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
is_complete(const const_tgba_digraph_ptr& aut)
|
is_complete(const const_twa_graph_ptr& aut)
|
||||||
{
|
{
|
||||||
unsigned ns = aut->num_states();
|
unsigned ns = aut->num_states();
|
||||||
for (unsigned src = 0; src < ns; ++src)
|
for (unsigned src = 0; src < ns; ++src)
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ namespace spot
|
||||||
/// but it is more efficient to call is_deterministic() if you do not
|
/// but it is more efficient to call is_deterministic() if you do not
|
||||||
/// care about the number of nondeterministic states.
|
/// care about the number of nondeterministic states.
|
||||||
SPOT_API unsigned
|
SPOT_API unsigned
|
||||||
count_nondet_states(const const_tgba_digraph_ptr& aut);
|
count_nondet_states(const const_twa_graph_ptr& aut);
|
||||||
|
|
||||||
/// \brief Return true iff \a aut is deterministic.
|
/// \brief Return true iff \a aut is deterministic.
|
||||||
///
|
///
|
||||||
|
|
@ -40,14 +40,14 @@ namespace spot
|
||||||
/// the automaton is nondeterministic, because it can return before
|
/// the automaton is nondeterministic, because it can return before
|
||||||
/// the entire automaton has been explored.
|
/// the entire automaton has been explored.
|
||||||
SPOT_API bool
|
SPOT_API bool
|
||||||
is_deterministic(const const_tgba_digraph_ptr& aut);
|
is_deterministic(const const_twa_graph_ptr& aut);
|
||||||
|
|
||||||
/// \brief Return true iff \a aut is complete.
|
/// \brief Return true iff \a aut is complete.
|
||||||
///
|
///
|
||||||
/// An automaton is complete if its translation relation is total,
|
/// An automaton is complete if its translation relation is total,
|
||||||
/// i.e., each state as a successor for any possible configuration.
|
/// i.e., each state as a successor for any possible configuration.
|
||||||
SPOT_API bool
|
SPOT_API bool
|
||||||
is_complete(const const_tgba_digraph_ptr& aut);
|
is_complete(const const_twa_graph_ptr& aut);
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,10 +45,10 @@ namespace spot
|
||||||
sba_(nullptr)
|
sba_(nullptr)
|
||||||
{
|
{
|
||||||
// Check if the automaton can be converted into a
|
// Check if the automaton can be converted into a
|
||||||
// tgba_digraph. This makes the state_is_accepting() function
|
// twa_graph. This makes the state_is_accepting() function
|
||||||
// more efficient.
|
// more efficient.
|
||||||
if (a->is_sba())
|
if (a->is_sba())
|
||||||
sba_ = std::dynamic_pointer_cast<const tgba_digraph>(a);
|
sba_ = std::dynamic_pointer_cast<const twa_graph>(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
@ -128,7 +128,7 @@ namespace spot
|
||||||
std::ostringstream body_;
|
std::ostringstream body_;
|
||||||
bdd all_acc_conds_;
|
bdd all_acc_conds_;
|
||||||
bool sba_format_;
|
bool sba_format_;
|
||||||
const_tgba_digraph_ptr sba_;
|
const_twa_graph_ptr sba_;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -110,15 +110,15 @@ namespace spot
|
||||||
|
|
||||||
class ratexp_to_dfa
|
class ratexp_to_dfa
|
||||||
{
|
{
|
||||||
typedef typename tgba_digraph::namer<const formula*>::type namer;
|
typedef typename twa_graph::namer<const formula*>::type namer;
|
||||||
public:
|
public:
|
||||||
ratexp_to_dfa(translate_dict& dict);
|
ratexp_to_dfa(translate_dict& dict);
|
||||||
std::tuple<const_tgba_digraph_ptr, const namer*, const state*>
|
std::tuple<const_twa_graph_ptr, const namer*, const state*>
|
||||||
succ(const formula* f);
|
succ(const formula* f);
|
||||||
~ratexp_to_dfa();
|
~ratexp_to_dfa();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef std::pair<tgba_digraph_ptr, const namer*> labelled_aut;
|
typedef std::pair<twa_graph_ptr, const namer*> labelled_aut;
|
||||||
labelled_aut translate(const formula* f);
|
labelled_aut translate(const formula* f);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
@ -1125,7 +1125,7 @@ namespace spot
|
||||||
{
|
{
|
||||||
assert(f->is_in_nenoform());
|
assert(f->is_in_nenoform());
|
||||||
|
|
||||||
auto a = make_tgba_digraph(dict_.dict);
|
auto a = make_twa_graph(dict_.dict);
|
||||||
auto namer = a->create_namer<const formula*>();
|
auto namer = a->create_namer<const formula*>();
|
||||||
|
|
||||||
typedef std::set<const formula*, formula_ptr_less_than> set_type;
|
typedef std::set<const formula*, formula_ptr_less_than> set_type;
|
||||||
|
|
@ -1252,7 +1252,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: use the new tgba::succ() interface
|
// FIXME: use the new tgba::succ() interface
|
||||||
std::tuple<const_tgba_digraph_ptr,
|
std::tuple<const_twa_graph_ptr,
|
||||||
const ratexp_to_dfa::namer*,
|
const ratexp_to_dfa::namer*,
|
||||||
const state*>
|
const state*>
|
||||||
ratexp_to_dfa::succ(const formula* f)
|
ratexp_to_dfa::succ(const formula* f)
|
||||||
|
|
@ -2200,7 +2200,7 @@ namespace spot
|
||||||
typedef std::vector<transition> dest_map;
|
typedef std::vector<transition> dest_map;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
ltl_to_tgba_fm(const formula* f, const bdd_dict_ptr& dict,
|
ltl_to_tgba_fm(const formula* f, const bdd_dict_ptr& dict,
|
||||||
bool exprop, bool symb_merge, bool branching_postponement,
|
bool exprop, bool symb_merge, bool branching_postponement,
|
||||||
bool fair_loop_approx, const atomic_prop_set* unobs,
|
bool fair_loop_approx, const atomic_prop_set* unobs,
|
||||||
|
|
@ -2231,7 +2231,7 @@ namespace spot
|
||||||
|
|
||||||
assert(dict == s->get_dict());
|
assert(dict == s->get_dict());
|
||||||
|
|
||||||
tgba_digraph_ptr a = make_tgba_digraph(dict);
|
twa_graph_ptr a = make_twa_graph(dict);
|
||||||
auto namer = a->create_namer<const formula*>();
|
auto namer = a->create_namer<const formula*>();
|
||||||
|
|
||||||
translate_dict d(dict, a->acc(), s, exprop, f->is_syntactic_persistence());
|
translate_dict d(dict, a->acc(), s, exprop, f->is_syntactic_persistence());
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
/// \ingroup tgba_ltl
|
/// \ingroup tgba_ltl
|
||||||
/// \brief Build a spot::tgba_digraph_ptr from an LTL formula.
|
/// \brief Build a spot::twa_graph_ptr from an LTL formula.
|
||||||
///
|
///
|
||||||
/// This is based on the following paper.
|
/// This is based on the following paper.
|
||||||
/** \verbatim
|
/** \verbatim
|
||||||
|
|
@ -120,8 +120,8 @@ namespace spot
|
||||||
}
|
}
|
||||||
\endverbatim */
|
\endverbatim */
|
||||||
///
|
///
|
||||||
/// \return A spot::tgba_digraph that recognizes the language of \a f.
|
/// \return A spot::twa_graph that recognizes the language of \a f.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
ltl_to_tgba_fm(const ltl::formula* f, const bdd_dict_ptr& dict,
|
ltl_to_tgba_fm(const ltl::formula* f, const bdd_dict_ptr& dict,
|
||||||
bool exprop = false, bool symb_merge = true,
|
bool exprop = false, bool symb_merge = true,
|
||||||
bool branching_postponement = false,
|
bool branching_postponement = false,
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,10 @@
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
tgba_digraph_ptr mask_acc_sets(const const_tgba_digraph_ptr& in,
|
twa_graph_ptr mask_acc_sets(const const_twa_graph_ptr& in,
|
||||||
acc_cond::mark_t to_remove)
|
acc_cond::mark_t to_remove)
|
||||||
{
|
{
|
||||||
auto res = make_tgba_digraph(in->get_dict());
|
auto res = make_twa_graph(in->get_dict());
|
||||||
res->copy_ap_of(in);
|
res->copy_ap_of(in);
|
||||||
res->prop_copy(in, { true, true, true, false });
|
res->prop_copy(in, { true, true, true, false });
|
||||||
unsigned na = in->acc().num_sets();
|
unsigned na = in->acc().num_sets();
|
||||||
|
|
@ -45,14 +45,14 @@ namespace spot
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr mask_keep_states(const const_tgba_digraph_ptr& in,
|
twa_graph_ptr mask_keep_states(const const_twa_graph_ptr& in,
|
||||||
std::vector<bool>& to_keep,
|
std::vector<bool>& to_keep,
|
||||||
unsigned int init)
|
unsigned int init)
|
||||||
{
|
{
|
||||||
if (to_keep.size() < in->num_states())
|
if (to_keep.size() < in->num_states())
|
||||||
to_keep.resize(in->num_states(), false);
|
to_keep.resize(in->num_states(), false);
|
||||||
|
|
||||||
auto res = make_tgba_digraph(in->get_dict());
|
auto res = make_twa_graph(in->get_dict());
|
||||||
res->copy_ap_of(in);
|
res->copy_ap_of(in);
|
||||||
res->prop_copy(in, { true, true, true, false });
|
res->prop_copy(in, { true, true, true, false });
|
||||||
res->copy_acceptance_of(in);
|
res->copy_acceptance_of(in);
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,8 @@ namespace spot
|
||||||
/// \param init The optional new initial state.
|
/// \param init The optional new initial state.
|
||||||
|
|
||||||
template<typename Trans>
|
template<typename Trans>
|
||||||
void transform_accessible(const const_tgba_digraph_ptr& old,
|
void transform_accessible(const const_twa_graph_ptr& old,
|
||||||
tgba_digraph_ptr& cpy,
|
twa_graph_ptr& cpy,
|
||||||
Trans trans, unsigned int init)
|
Trans trans, unsigned int init)
|
||||||
{
|
{
|
||||||
std::vector<unsigned> todo;
|
std::vector<unsigned> todo;
|
||||||
|
|
@ -97,8 +97,8 @@ namespace spot
|
||||||
/// all transtions will be processed.
|
/// all transtions will be processed.
|
||||||
/// \param init The optional new initial state.
|
/// \param init The optional new initial state.
|
||||||
template<typename Trans>
|
template<typename Trans>
|
||||||
void transform_copy(const const_tgba_digraph_ptr& old,
|
void transform_copy(const const_twa_graph_ptr& old,
|
||||||
tgba_digraph_ptr& cpy,
|
twa_graph_ptr& cpy,
|
||||||
Trans trans, unsigned int init)
|
Trans trans, unsigned int init)
|
||||||
{
|
{
|
||||||
// Each state in cpy corresponds to a unique state in old.
|
// Each state in cpy corresponds to a unique state in old.
|
||||||
|
|
@ -119,15 +119,15 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Trans>
|
template<typename Trans>
|
||||||
void transform_accessible(const const_tgba_digraph_ptr& old,
|
void transform_accessible(const const_twa_graph_ptr& old,
|
||||||
tgba_digraph_ptr& cpy,
|
twa_graph_ptr& cpy,
|
||||||
Trans trans)
|
Trans trans)
|
||||||
{
|
{
|
||||||
transform_accessible(old, cpy, trans, old->get_init_state_number());
|
transform_accessible(old, cpy, trans, old->get_init_state_number());
|
||||||
}
|
}
|
||||||
template<typename Trans>
|
template<typename Trans>
|
||||||
void transform_copy(const const_tgba_digraph_ptr& old,
|
void transform_copy(const const_twa_graph_ptr& old,
|
||||||
tgba_digraph_ptr& cpy,
|
twa_graph_ptr& cpy,
|
||||||
Trans trans)
|
Trans trans)
|
||||||
{
|
{
|
||||||
transform_copy(old, cpy, trans, old->get_init_state_number());
|
transform_copy(old, cpy, trans, old->get_init_state_number());
|
||||||
|
|
@ -135,7 +135,7 @@ namespace spot
|
||||||
|
|
||||||
/// \brief Remove all transitions that are in some given acceptance sets.
|
/// \brief Remove all transitions that are in some given acceptance sets.
|
||||||
SPOT_API
|
SPOT_API
|
||||||
tgba_digraph_ptr mask_acc_sets(const const_tgba_digraph_ptr& in,
|
twa_graph_ptr mask_acc_sets(const const_twa_graph_ptr& in,
|
||||||
acc_cond::mark_t to_remove);
|
acc_cond::mark_t to_remove);
|
||||||
|
|
||||||
/// \brief Keep only the states as specified by \a to_keep.
|
/// \brief Keep only the states as specified by \a to_keep.
|
||||||
|
|
@ -143,7 +143,7 @@ namespace spot
|
||||||
/// Each index in the vector \a to_keep specifies wether or not to keep that
|
/// Each index in the vector \a to_keep specifies wether or not to keep that
|
||||||
/// state. The initial state will be set to \a init.
|
/// state. The initial state will be set to \a init.
|
||||||
SPOT_API
|
SPOT_API
|
||||||
tgba_digraph_ptr mask_keep_states(const const_tgba_digraph_ptr& in,
|
twa_graph_ptr mask_keep_states(const const_twa_graph_ptr& in,
|
||||||
std::vector<bool>& to_keep,
|
std::vector<bool>& to_keep,
|
||||||
unsigned int init);
|
unsigned int init);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,12 +114,12 @@ namespace spot
|
||||||
|
|
||||||
// From the base automaton and the list of sets, build the minimal
|
// From the base automaton and the list of sets, build the minimal
|
||||||
// resulting automaton
|
// resulting automaton
|
||||||
tgba_digraph_ptr build_result(const const_tgba_ptr& a,
|
twa_graph_ptr build_result(const const_tgba_ptr& a,
|
||||||
std::list<hash_set*>& sets,
|
std::list<hash_set*>& sets,
|
||||||
hash_set* final)
|
hash_set* final)
|
||||||
{
|
{
|
||||||
auto dict = a->get_dict();
|
auto dict = a->get_dict();
|
||||||
auto res = make_tgba_digraph(dict);
|
auto res = make_twa_graph(dict);
|
||||||
res->copy_ap_of(a);
|
res->copy_ap_of(a);
|
||||||
res->prop_state_based_acc();
|
res->prop_state_based_acc();
|
||||||
|
|
||||||
|
|
@ -194,7 +194,7 @@ namespace spot
|
||||||
filter(const state* s)
|
filter(const state* s)
|
||||||
{
|
{
|
||||||
s = seen(s);
|
s = seen(s);
|
||||||
if (sm.scc_of(std::static_pointer_cast<const tgba_digraph>(a_)
|
if (sm.scc_of(std::static_pointer_cast<const twa_graph>(a_)
|
||||||
->state_number(s)) != scc_n)
|
->state_number(s)) != scc_n)
|
||||||
return 0;
|
return 0;
|
||||||
return s;
|
return s;
|
||||||
|
|
@ -215,8 +215,8 @@ namespace spot
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
wdba_scc_is_accepting(const const_tgba_digraph_ptr& det_a, unsigned scc_n,
|
wdba_scc_is_accepting(const const_twa_graph_ptr& det_a, unsigned scc_n,
|
||||||
const const_tgba_digraph_ptr& orig_a, scc_info& sm,
|
const const_twa_graph_ptr& orig_a, scc_info& sm,
|
||||||
power_map& pm)
|
power_map& pm)
|
||||||
{
|
{
|
||||||
// Get some state from the SCC #n.
|
// Get some state from the SCC #n.
|
||||||
|
|
@ -230,7 +230,7 @@ namespace spot
|
||||||
(void)reached;
|
(void)reached;
|
||||||
|
|
||||||
// Build an automaton representing this loop.
|
// Build an automaton representing this loop.
|
||||||
auto loop_a = make_tgba_digraph(det_a->get_dict());
|
auto loop_a = make_twa_graph(det_a->get_dict());
|
||||||
tgba_run::steps::const_iterator i;
|
tgba_run::steps::const_iterator i;
|
||||||
int loop_size = loop.size();
|
int loop_size = loop.size();
|
||||||
loop_a->new_states(loop_size);
|
loop_a->new_states(loop_size);
|
||||||
|
|
@ -269,7 +269,7 @@ namespace spot
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr minimize_dfa(const const_tgba_digraph_ptr& det_a,
|
twa_graph_ptr minimize_dfa(const const_twa_graph_ptr& det_a,
|
||||||
hash_set* final, hash_set* non_final)
|
hash_set* final, hash_set* non_final)
|
||||||
{
|
{
|
||||||
typedef std::list<hash_set*> partition_t;
|
typedef std::list<hash_set*> partition_t;
|
||||||
|
|
@ -475,11 +475,11 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tgba_digraph_ptr minimize_monitor(const const_tgba_digraph_ptr& a)
|
twa_graph_ptr minimize_monitor(const const_twa_graph_ptr& a)
|
||||||
{
|
{
|
||||||
hash_set* final = new hash_set;
|
hash_set* final = new hash_set;
|
||||||
hash_set* non_final = new hash_set;
|
hash_set* non_final = new hash_set;
|
||||||
tgba_digraph_ptr det_a = tgba_powerset(a);
|
twa_graph_ptr det_a = tgba_powerset(a);
|
||||||
|
|
||||||
// non_final contain all states.
|
// non_final contain all states.
|
||||||
// final is empty: there is no acceptance condition
|
// final is empty: there is no acceptance condition
|
||||||
|
|
@ -492,7 +492,7 @@ namespace spot
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr minimize_wdba(const const_tgba_digraph_ptr& a)
|
twa_graph_ptr minimize_wdba(const const_twa_graph_ptr& a)
|
||||||
{
|
{
|
||||||
if (a->acc().uses_fin_acceptance())
|
if (a->acc().uses_fin_acceptance())
|
||||||
throw std::runtime_error
|
throw std::runtime_error
|
||||||
|
|
@ -501,7 +501,7 @@ namespace spot
|
||||||
hash_set* final = new hash_set;
|
hash_set* final = new hash_set;
|
||||||
hash_set* non_final = new hash_set;
|
hash_set* non_final = new hash_set;
|
||||||
|
|
||||||
tgba_digraph_ptr det_a;
|
twa_graph_ptr det_a;
|
||||||
|
|
||||||
{
|
{
|
||||||
power_map pm;
|
power_map pm;
|
||||||
|
|
@ -595,10 +595,10 @@ namespace spot
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
minimize_obligation(const const_tgba_digraph_ptr& aut_f,
|
minimize_obligation(const const_twa_graph_ptr& aut_f,
|
||||||
const ltl::formula* f,
|
const ltl::formula* f,
|
||||||
const_tgba_digraph_ptr aut_neg_f,
|
const_twa_graph_ptr aut_neg_f,
|
||||||
bool reject_bigger)
|
bool reject_bigger)
|
||||||
{
|
{
|
||||||
auto min_aut_f = minimize_wdba(aut_f);
|
auto min_aut_f = minimize_wdba(aut_f);
|
||||||
|
|
@ -608,7 +608,7 @@ namespace spot
|
||||||
// Abort if min_aut_f has more states than aut_f.
|
// Abort if min_aut_f has more states than aut_f.
|
||||||
unsigned orig_states = aut_f->num_states();
|
unsigned orig_states = aut_f->num_states();
|
||||||
if (orig_states < min_aut_f->num_states())
|
if (orig_states < min_aut_f->num_states())
|
||||||
return std::const_pointer_cast<tgba_digraph>(aut_f);
|
return std::const_pointer_cast<twa_graph>(aut_f);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the input automaton was already weak and deterministic, the
|
// If the input automaton was already weak and deterministic, the
|
||||||
|
|
@ -675,6 +675,6 @@ namespace spot
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
return min_aut_f;
|
return min_aut_f;
|
||||||
return std::const_pointer_cast<tgba_digraph>(aut_f);
|
return std::const_pointer_cast<twa_graph>(aut_f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ namespace spot
|
||||||
/// \param a the automaton to convert into a minimal deterministic monitor
|
/// \param a the automaton to convert into a minimal deterministic monitor
|
||||||
/// \pre Dead SCCs should have been removed from \a a before
|
/// \pre Dead SCCs should have been removed from \a a before
|
||||||
/// calling this function.
|
/// calling this function.
|
||||||
SPOT_API tgba_digraph_ptr minimize_monitor(const const_tgba_digraph_ptr& a);
|
SPOT_API twa_graph_ptr minimize_monitor(const const_twa_graph_ptr& a);
|
||||||
|
|
||||||
/// \brief Minimize a Büchi automaton in the WDBA class.
|
/// \brief Minimize a Büchi automaton in the WDBA class.
|
||||||
///
|
///
|
||||||
|
|
@ -92,7 +92,7 @@ namespace spot
|
||||||
month = oct
|
month = oct
|
||||||
}
|
}
|
||||||
\endverbatim */
|
\endverbatim */
|
||||||
SPOT_API tgba_digraph_ptr minimize_wdba(const const_tgba_digraph_ptr& a);
|
SPOT_API twa_graph_ptr minimize_wdba(const const_twa_graph_ptr& a);
|
||||||
|
|
||||||
/// \brief Minimize an automaton if it represents an obligation property.
|
/// \brief Minimize an automaton if it represents an obligation property.
|
||||||
///
|
///
|
||||||
|
|
@ -149,10 +149,10 @@ namespace spot
|
||||||
/// determinization step during minimize_wdba().) Note that
|
/// determinization step during minimize_wdba().) Note that
|
||||||
/// checking the size of the minimized WDBA occurs before ensuring
|
/// checking the size of the minimized WDBA occurs before ensuring
|
||||||
/// that the minimized WDBA is correct.
|
/// that the minimized WDBA is correct.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
minimize_obligation(const const_tgba_digraph_ptr& aut_f,
|
minimize_obligation(const const_twa_graph_ptr& aut_f,
|
||||||
const ltl::formula* f = 0,
|
const ltl::formula* f = 0,
|
||||||
const_tgba_digraph_ptr aut_neg_f = nullptr,
|
const_twa_graph_ptr aut_neg_f = nullptr,
|
||||||
bool reject_bigger = false);
|
bool reject_bigger = false);
|
||||||
/// @}
|
/// @}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ namespace spot
|
||||||
bool opt_comments_ = false;
|
bool opt_comments_ = false;
|
||||||
std::vector<std::string>* sn_ = nullptr;
|
std::vector<std::string>* sn_ = nullptr;
|
||||||
bool opt_624_ = false;
|
bool opt_624_ = false;
|
||||||
const_tgba_digraph_ptr aut_;
|
const_twa_graph_ptr aut_;
|
||||||
bool fi_needed_ = false;
|
bool fi_needed_ = false;
|
||||||
bool need_accept_all_ = false;
|
bool need_accept_all_ = false;
|
||||||
unsigned accept_all_ = 0;
|
unsigned accept_all_ = 0;
|
||||||
|
|
@ -183,7 +183,7 @@ namespace spot
|
||||||
os_ << (opt_624_ ? " od;\n" : " fi;\n");
|
os_ << (opt_624_ ? " od;\n" : " fi;\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void print(const const_tgba_digraph_ptr& aut)
|
void print(const const_twa_graph_ptr& aut)
|
||||||
{
|
{
|
||||||
aut_ = aut;
|
aut_ = aut;
|
||||||
if (opt_comments_)
|
if (opt_comments_)
|
||||||
|
|
@ -208,9 +208,9 @@ namespace spot
|
||||||
throw std::runtime_error
|
throw std::runtime_error
|
||||||
("Never claim output only supports Büchi acceptance");
|
("Never claim output only supports Büchi acceptance");
|
||||||
never_claim_output d(os, options);
|
never_claim_output d(os, options);
|
||||||
auto aut = std::dynamic_pointer_cast<const tgba_digraph>(g);
|
auto aut = std::dynamic_pointer_cast<const twa_graph>(g);
|
||||||
if (!aut)
|
if (!aut)
|
||||||
aut = make_tgba_digraph(g, twa::prop_set::all());
|
aut = make_twa_graph(g, twa::prop_set::all());
|
||||||
d.print(aut);
|
d.print(aut);
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,8 @@ namespace spot
|
||||||
{
|
{
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
static tgba_digraph_ptr
|
static twa_graph_ptr
|
||||||
ensure_ba(tgba_digraph_ptr& a)
|
ensure_ba(twa_graph_ptr& a)
|
||||||
{
|
{
|
||||||
if (a->acc().num_sets() == 0)
|
if (a->acc().num_sets() == 0)
|
||||||
{
|
{
|
||||||
|
|
@ -89,8 +89,8 @@ namespace spot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
postprocessor::do_simul(const tgba_digraph_ptr& a, int opt)
|
postprocessor::do_simul(const twa_graph_ptr& a, int opt)
|
||||||
{
|
{
|
||||||
switch (opt)
|
switch (opt)
|
||||||
{
|
{
|
||||||
|
|
@ -106,8 +106,8 @@ namespace spot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
postprocessor::do_ba_simul(const tgba_digraph_ptr& a, int opt)
|
postprocessor::do_ba_simul(const twa_graph_ptr& a, int opt)
|
||||||
{
|
{
|
||||||
switch (opt)
|
switch (opt)
|
||||||
{
|
{
|
||||||
|
|
@ -123,8 +123,8 @@ namespace spot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
postprocessor::do_degen(const tgba_digraph_ptr& a)
|
postprocessor::do_degen(const twa_graph_ptr& a)
|
||||||
{
|
{
|
||||||
auto d = degeneralize(a,
|
auto d = degeneralize(a,
|
||||||
degen_reset_, degen_order_,
|
degen_reset_, degen_order_,
|
||||||
|
|
@ -138,8 +138,8 @@ namespace spot
|
||||||
#define PREF_ (pref_ & (Small | Deterministic))
|
#define PREF_ (pref_ & (Small | Deterministic))
|
||||||
#define COMP_ (pref_ & Complete)
|
#define COMP_ (pref_ & Complete)
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
postprocessor::run(tgba_digraph_ptr a, const ltl::formula* f)
|
postprocessor::run(twa_graph_ptr a, const ltl::formula* f)
|
||||||
{
|
{
|
||||||
if (type_ != Generic && !a->acc().is_generalized_buchi())
|
if (type_ != Generic && !a->acc().is_generalized_buchi())
|
||||||
a = to_generalized_buchi(a);
|
a = to_generalized_buchi(a);
|
||||||
|
|
@ -215,8 +215,8 @@ namespace spot
|
||||||
|
|
||||||
bool dba_is_wdba = false;
|
bool dba_is_wdba = false;
|
||||||
bool dba_is_minimal = false;
|
bool dba_is_minimal = false;
|
||||||
tgba_digraph_ptr dba = 0;
|
twa_graph_ptr dba = 0;
|
||||||
tgba_digraph_ptr sim = 0;
|
twa_graph_ptr sim = 0;
|
||||||
|
|
||||||
// (Small,Low) is the only configuration where we do not run
|
// (Small,Low) is the only configuration where we do not run
|
||||||
// WDBA-minimization.
|
// WDBA-minimization.
|
||||||
|
|
@ -269,7 +269,7 @@ namespace spot
|
||||||
// If we don't have a DBA, attempt tba-determinization if requested.
|
// If we don't have a DBA, attempt tba-determinization if requested.
|
||||||
if (tba_determinisation_ && !dba)
|
if (tba_determinisation_ && !dba)
|
||||||
{
|
{
|
||||||
tgba_digraph_ptr tmpd = nullptr;
|
twa_graph_ptr tmpd = nullptr;
|
||||||
if (PREF_ == Deterministic
|
if (PREF_ == Deterministic
|
||||||
&& f
|
&& f
|
||||||
&& f->is_syntactic_recurrence()
|
&& f->is_syntactic_recurrence()
|
||||||
|
|
@ -334,7 +334,7 @@ namespace spot
|
||||||
// sure it is at least 1.
|
// sure it is at least 1.
|
||||||
target_acc = original_acc > 0 ? original_acc : 1;
|
target_acc = original_acc > 0 ? original_acc : 1;
|
||||||
|
|
||||||
const_tgba_digraph_ptr in = 0;
|
const_twa_graph_ptr in = 0;
|
||||||
if (target_acc == 1)
|
if (target_acc == 1)
|
||||||
{
|
{
|
||||||
// If we are seeking a minimal DBA with unknown number of
|
// If we are seeking a minimal DBA with unknown number of
|
||||||
|
|
@ -352,7 +352,7 @@ namespace spot
|
||||||
in = dba;
|
in = dba;
|
||||||
}
|
}
|
||||||
|
|
||||||
const_tgba_digraph_ptr res = tgba_complete(in);
|
const_twa_graph_ptr res = tgba_complete(in);
|
||||||
if (target_acc == 1)
|
if (target_acc == 1)
|
||||||
{
|
{
|
||||||
if (sat_states_ != -1)
|
if (sat_states_ != -1)
|
||||||
|
|
|
||||||
|
|
@ -99,13 +99,13 @@ namespace spot
|
||||||
///
|
///
|
||||||
/// The returned automaton might be a new automaton,
|
/// The returned automaton might be a new automaton,
|
||||||
/// or an in-place modification of the \a input automaton.
|
/// or an in-place modification of the \a input automaton.
|
||||||
tgba_digraph_ptr run(tgba_digraph_ptr input,
|
twa_graph_ptr run(twa_graph_ptr input,
|
||||||
const ltl::formula* f);
|
const ltl::formula* f);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
tgba_digraph_ptr do_simul(const tgba_digraph_ptr& input, int opt);
|
twa_graph_ptr do_simul(const twa_graph_ptr& input, int opt);
|
||||||
tgba_digraph_ptr do_ba_simul(const tgba_digraph_ptr& input, int opt);
|
twa_graph_ptr do_ba_simul(const twa_graph_ptr& input, int opt);
|
||||||
tgba_digraph_ptr do_degen(const tgba_digraph_ptr& input);
|
twa_graph_ptr do_degen(const twa_graph_ptr& input);
|
||||||
|
|
||||||
output_type type_;
|
output_type type_;
|
||||||
int pref_;
|
int pref_;
|
||||||
|
|
|
||||||
|
|
@ -85,8 +85,8 @@ namespace spot
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
tgba_powerset(const const_tgba_digraph_ptr& aut, power_map& pm, bool merge)
|
tgba_powerset(const const_twa_graph_ptr& aut, power_map& pm, bool merge)
|
||||||
{
|
{
|
||||||
bdd allap = bddtrue;
|
bdd allap = bddtrue;
|
||||||
{
|
{
|
||||||
|
|
@ -155,7 +155,7 @@ namespace spot
|
||||||
|
|
||||||
std::vector<const bitvect*>toclean;
|
std::vector<const bitvect*>toclean;
|
||||||
|
|
||||||
auto res = make_tgba_digraph(aut->get_dict());
|
auto res = make_twa_graph(aut->get_dict());
|
||||||
res->copy_ap_of(aut);
|
res->copy_ap_of(aut);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -217,8 +217,8 @@ namespace spot
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
tgba_powerset(const const_tgba_digraph_ptr& aut)
|
tgba_powerset(const const_twa_graph_ptr& aut)
|
||||||
{
|
{
|
||||||
power_map pm;
|
power_map pm;
|
||||||
return tgba_powerset(aut, pm);
|
return tgba_powerset(aut, pm);
|
||||||
|
|
@ -236,7 +236,7 @@ namespace spot
|
||||||
typedef std::set<trans*> trans_set;
|
typedef std::set<trans*> trans_set;
|
||||||
typedef std::vector<trans_set> set_set;
|
typedef std::vector<trans_set> set_set;
|
||||||
protected:
|
protected:
|
||||||
const_tgba_digraph_ptr ref_;
|
const_twa_graph_ptr ref_;
|
||||||
power_map& refmap_;
|
power_map& refmap_;
|
||||||
trans_set reject_; // set of rejecting transitions
|
trans_set reject_; // set of rejecting transitions
|
||||||
set_set accept_; // set of cycles that are accepting
|
set_set accept_; // set of cycles that are accepting
|
||||||
|
|
@ -245,7 +245,7 @@ namespace spot
|
||||||
unsigned cycles_left_; // count of cycles left to explore
|
unsigned cycles_left_; // count of cycles left to explore
|
||||||
|
|
||||||
public:
|
public:
|
||||||
fix_scc_acceptance(const scc_info& sm, const_tgba_digraph_ptr ref,
|
fix_scc_acceptance(const scc_info& sm, const_twa_graph_ptr ref,
|
||||||
power_map& refmap, unsigned threshold)
|
power_map& refmap, unsigned threshold)
|
||||||
: enumerate_cycles(sm), ref_(ref), refmap_(refmap),
|
: enumerate_cycles(sm), ref_(ref), refmap_(refmap),
|
||||||
threshold_(threshold)
|
threshold_(threshold)
|
||||||
|
|
@ -279,10 +279,10 @@ namespace spot
|
||||||
|
|
||||||
bool is_cycle_accepting(cycle_iter begin, trans_set& ts) const
|
bool is_cycle_accepting(cycle_iter begin, trans_set& ts) const
|
||||||
{
|
{
|
||||||
auto a = std::const_pointer_cast<tgba_digraph>(aut_);
|
auto a = std::const_pointer_cast<twa_graph>(aut_);
|
||||||
|
|
||||||
// Build an automaton representing this loop.
|
// Build an automaton representing this loop.
|
||||||
auto loop_a = make_tgba_digraph(aut_->get_dict());
|
auto loop_a = make_twa_graph(aut_->get_dict());
|
||||||
int loop_size = std::distance(begin, dfs_.end());
|
int loop_size = std::distance(begin, dfs_.end());
|
||||||
loop_a->new_states(loop_size);
|
loop_a->new_states(loop_size);
|
||||||
int n;
|
int n;
|
||||||
|
|
@ -362,8 +362,8 @@ namespace spot
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
fix_dba_acceptance(tgba_digraph_ptr det,
|
fix_dba_acceptance(twa_graph_ptr det,
|
||||||
const_tgba_digraph_ptr ref, power_map& refmap,
|
const_twa_graph_ptr ref, power_map& refmap,
|
||||||
unsigned threshold)
|
unsigned threshold)
|
||||||
{
|
{
|
||||||
det->copy_acceptance_of(ref);
|
det->copy_acceptance_of(ref);
|
||||||
|
|
@ -382,8 +382,8 @@ namespace spot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
tba_determinize(const const_tgba_digraph_ptr& aut,
|
tba_determinize(const const_twa_graph_ptr& aut,
|
||||||
unsigned threshold_states, unsigned threshold_cycles)
|
unsigned threshold_states, unsigned threshold_cycles)
|
||||||
{
|
{
|
||||||
power_map pm;
|
power_map pm;
|
||||||
|
|
@ -401,12 +401,12 @@ namespace spot
|
||||||
return det;
|
return det;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
tba_determinize_check(const tgba_digraph_ptr& aut,
|
tba_determinize_check(const twa_graph_ptr& aut,
|
||||||
unsigned threshold_states,
|
unsigned threshold_states,
|
||||||
unsigned threshold_cycles,
|
unsigned threshold_cycles,
|
||||||
const ltl::formula* f,
|
const ltl::formula* f,
|
||||||
const_tgba_digraph_ptr neg_aut)
|
const_twa_graph_ptr neg_aut)
|
||||||
{
|
{
|
||||||
if (f == 0 && neg_aut == 0)
|
if (f == 0 && neg_aut == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -54,11 +54,11 @@ namespace spot
|
||||||
/// The \a merge argument can be set to false to prevent merging of
|
/// The \a merge argument can be set to false to prevent merging of
|
||||||
/// transitions.
|
/// transitions.
|
||||||
//@{
|
//@{
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
tgba_powerset(const const_tgba_digraph_ptr& aut,
|
tgba_powerset(const const_twa_graph_ptr& aut,
|
||||||
power_map& pm, bool merge = true);
|
power_map& pm, bool merge = true);
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
tgba_powerset(const const_tgba_digraph_ptr& aut);
|
tgba_powerset(const const_twa_graph_ptr& aut);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -97,8 +97,8 @@ namespace spot
|
||||||
/// If \a threshold_cycles is non null, abort the construction
|
/// If \a threshold_cycles is non null, abort the construction
|
||||||
/// whenever an SCC of the constructed automaton has more than \a
|
/// whenever an SCC of the constructed automaton has more than \a
|
||||||
/// threshold_cycles cycles.
|
/// threshold_cycles cycles.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
tba_determinize(const const_tgba_digraph_ptr& aut,
|
tba_determinize(const const_twa_graph_ptr& aut,
|
||||||
unsigned threshold_states = 0,
|
unsigned threshold_states = 0,
|
||||||
unsigned threshold_cycles = 0);
|
unsigned threshold_cycles = 0);
|
||||||
|
|
||||||
|
|
@ -129,11 +129,11 @@ namespace spot
|
||||||
/// the automaton cannot be determinized, 0 if we do not know if the
|
/// the automaton cannot be determinized, 0 if we do not know if the
|
||||||
/// determinization is correct because neither \a f nor \a neg_aut
|
/// determinization is correct because neither \a f nor \a neg_aut
|
||||||
/// were supplied.
|
/// were supplied.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
tba_determinize_check(const tgba_digraph_ptr& aut,
|
tba_determinize_check(const twa_graph_ptr& aut,
|
||||||
unsigned threshold_states = 0,
|
unsigned threshold_states = 0,
|
||||||
unsigned threshold_cycles = 0,
|
unsigned threshold_cycles = 0,
|
||||||
const ltl::formula* f = 0,
|
const ltl::formula* f = 0,
|
||||||
const_tgba_digraph_ptr neg_aut = 0);
|
const_twa_graph_ptr neg_aut = 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,8 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tgba_digraph_ptr product(const const_tgba_digraph_ptr& left,
|
twa_graph_ptr product(const const_twa_graph_ptr& left,
|
||||||
const const_tgba_digraph_ptr& right,
|
const const_twa_graph_ptr& right,
|
||||||
unsigned left_state,
|
unsigned left_state,
|
||||||
unsigned right_state)
|
unsigned right_state)
|
||||||
{
|
{
|
||||||
|
|
@ -49,7 +49,7 @@ namespace spot
|
||||||
std::deque<std::pair<product_state, unsigned>> todo;
|
std::deque<std::pair<product_state, unsigned>> todo;
|
||||||
|
|
||||||
assert(left->get_dict() == right->get_dict());
|
assert(left->get_dict() == right->get_dict());
|
||||||
auto res = make_tgba_digraph(left->get_dict());
|
auto res = make_twa_graph(left->get_dict());
|
||||||
res->copy_ap_of(left);
|
res->copy_ap_of(left);
|
||||||
res->copy_ap_of(right);
|
res->copy_ap_of(right);
|
||||||
auto left_num = left->acc().num_sets();
|
auto left_num = left->acc().num_sets();
|
||||||
|
|
@ -102,8 +102,8 @@ namespace spot
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr product(const const_tgba_digraph_ptr& left,
|
twa_graph_ptr product(const const_twa_graph_ptr& left,
|
||||||
const const_tgba_digraph_ptr& right)
|
const const_twa_graph_ptr& right)
|
||||||
{
|
{
|
||||||
return product(left, right,
|
return product(left, right,
|
||||||
left->get_init_state_number(),
|
left->get_init_state_number(),
|
||||||
|
|
|
||||||
|
|
@ -31,12 +31,12 @@ namespace spot
|
||||||
typedef std::vector<std::pair<unsigned, unsigned>> product_states;
|
typedef std::vector<std::pair<unsigned, unsigned>> product_states;
|
||||||
|
|
||||||
SPOT_API
|
SPOT_API
|
||||||
tgba_digraph_ptr product(const const_tgba_digraph_ptr& left,
|
twa_graph_ptr product(const const_twa_graph_ptr& left,
|
||||||
const const_tgba_digraph_ptr& right);
|
const const_twa_graph_ptr& right);
|
||||||
|
|
||||||
SPOT_API
|
SPOT_API
|
||||||
tgba_digraph_ptr product(const const_tgba_digraph_ptr& left,
|
twa_graph_ptr product(const const_twa_graph_ptr& left,
|
||||||
const const_tgba_digraph_ptr& right,
|
const const_twa_graph_ptr& right,
|
||||||
unsigned left_state,
|
unsigned left_state,
|
||||||
unsigned right_state);
|
unsigned right_state);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
acc_cond::mark_t
|
acc_cond::mark_t
|
||||||
random_acc_cond(tgba_digraph_ptr aut, unsigned n_accs, float a)
|
random_acc_cond(twa_graph_ptr aut, unsigned n_accs, float a)
|
||||||
{
|
{
|
||||||
acc_cond::mark_t m = 0U;
|
acc_cond::mark_t m = 0U;
|
||||||
for (unsigned i = 0U; i < n_accs; ++i)
|
for (unsigned i = 0U; i < n_accs; ++i)
|
||||||
|
|
@ -114,14 +114,14 @@ namespace spot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
random_graph(int n, float d,
|
random_graph(int n, float d,
|
||||||
const ltl::atomic_prop_set* ap, const bdd_dict_ptr& dict,
|
const ltl::atomic_prop_set* ap, const bdd_dict_ptr& dict,
|
||||||
unsigned n_accs, float a, float t,
|
unsigned n_accs, float a, float t,
|
||||||
bool deterministic, bool state_acc)
|
bool deterministic, bool state_acc)
|
||||||
{
|
{
|
||||||
assert(n > 0);
|
assert(n > 0);
|
||||||
auto res = make_tgba_digraph(dict);
|
auto res = make_twa_graph(dict);
|
||||||
if (deterministic)
|
if (deterministic)
|
||||||
res->prop_deterministic();
|
res->prop_deterministic();
|
||||||
if (state_acc)
|
if (state_acc)
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ namespace spot
|
||||||
/// \f$1+(n-1)d\f$ and variance \f$(n-1)d(1-d)\f$. (This is less
|
/// \f$1+(n-1)d\f$ and variance \f$(n-1)d(1-d)\f$. (This is less
|
||||||
/// accurate, but faster than considering all possible \a n
|
/// accurate, but faster than considering all possible \a n
|
||||||
/// successors one by one.)
|
/// successors one by one.)
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
random_graph(int n, float d,
|
random_graph(int n, float d,
|
||||||
const ltl::atomic_prop_set* ap, const bdd_dict_ptr& dict,
|
const ltl::atomic_prop_set* ap, const bdd_dict_ptr& dict,
|
||||||
unsigned n_accs = 0, float a = 0.1, float t = 0.5,
|
unsigned n_accs = 0, float a = 0.1, float t = 0.5,
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
void
|
void
|
||||||
randomize(tgba_digraph_ptr& aut, bool randomize_states,
|
randomize(twa_graph_ptr& aut, bool randomize_states,
|
||||||
bool randomize_transitions)
|
bool randomize_transitions)
|
||||||
{
|
{
|
||||||
if (!randomize_states && !randomize_transitions)
|
if (!randomize_states && !randomize_transitions)
|
||||||
|
|
@ -58,7 +58,7 @@ namespace spot
|
||||||
mrandom_shuffle(v.begin() + 1, v.end());
|
mrandom_shuffle(v.begin() + 1, v.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef tgba_digraph::graph_t::trans_storage_t tr_t;
|
typedef twa_graph::graph_t::trans_storage_t tr_t;
|
||||||
g.sort_transitions_([](const tr_t& lhs, const tr_t& rhs)
|
g.sort_transitions_([](const tr_t& lhs, const tr_t& rhs)
|
||||||
{ return lhs.src < rhs.src; });
|
{ return lhs.src < rhs.src; });
|
||||||
g.chain_transitions_();
|
g.chain_transitions_();
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ namespace spot
|
||||||
/// Make a random permutation of the state, and of the transitions
|
/// Make a random permutation of the state, and of the transitions
|
||||||
/// leaving this state.
|
/// leaving this state.
|
||||||
SPOT_API void
|
SPOT_API void
|
||||||
randomize(tgba_digraph_ptr& aut,
|
randomize(twa_graph_ptr& aut,
|
||||||
bool randomize_states = true,
|
bool randomize_states = true,
|
||||||
bool randomize_transitions = true);
|
bool randomize_transitions = true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
void
|
void
|
||||||
relabel_here(tgba_digraph_ptr& aut, ltl::relabeling_map* relmap)
|
relabel_here(twa_graph_ptr& aut, ltl::relabeling_map* relmap)
|
||||||
{
|
{
|
||||||
bddPair* pairs = bdd_newpair();
|
bddPair* pairs = bdd_newpair();
|
||||||
auto d = aut->get_dict();
|
auto d = aut->get_dict();
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,6 @@ namespace spot
|
||||||
{
|
{
|
||||||
/// replace atomic propositions in an automaton
|
/// replace atomic propositions in an automaton
|
||||||
SPOT_API void
|
SPOT_API void
|
||||||
relabel_here(tgba_digraph_ptr& aut,
|
relabel_here(twa_graph_ptr& aut,
|
||||||
ltl::relabeling_map* relmap);
|
ltl::relabeling_map* relmap);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -108,10 +108,10 @@ namespace spot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr remove_fin(const const_tgba_digraph_ptr& aut)
|
twa_graph_ptr remove_fin(const const_twa_graph_ptr& aut)
|
||||||
{
|
{
|
||||||
if (!aut->acc().uses_fin_acceptance())
|
if (!aut->acc().uses_fin_acceptance())
|
||||||
return std::const_pointer_cast<tgba_digraph>(aut);
|
return std::const_pointer_cast<twa_graph>(aut);
|
||||||
|
|
||||||
std::vector<acc_cond::acc_code> code;
|
std::vector<acc_cond::acc_code> code;
|
||||||
std::vector<acc_cond::mark_t> rem;
|
std::vector<acc_cond::mark_t> rem;
|
||||||
|
|
@ -260,7 +260,7 @@ namespace spot
|
||||||
scc_info si(aut);
|
scc_info si(aut);
|
||||||
|
|
||||||
unsigned nst = aut->num_states();
|
unsigned nst = aut->num_states();
|
||||||
auto res = make_tgba_digraph(aut->get_dict());
|
auto res = make_twa_graph(aut->get_dict());
|
||||||
res->copy_ap_of(aut);
|
res->copy_ap_of(aut);
|
||||||
res->prop_copy(aut, { false, false, false, true });
|
res->prop_copy(aut, { false, false, false, true });
|
||||||
res->new_states(nst);
|
res->new_states(nst);
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,6 @@
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
/// \brief Rewrite an automaton without Fin acceptance.
|
/// \brief Rewrite an automaton without Fin acceptance.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
remove_fin(const const_tgba_digraph_ptr& aut);
|
remove_fin(const const_twa_graph_ptr& aut);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -138,13 +138,13 @@ namespace spot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr remove_ap::strip(const_tgba_digraph_ptr aut) const
|
twa_graph_ptr remove_ap::strip(const_twa_graph_ptr aut) const
|
||||||
{
|
{
|
||||||
bdd restrict = bddtrue;
|
bdd restrict = bddtrue;
|
||||||
bdd exist = bddtrue;
|
bdd exist = bddtrue;
|
||||||
auto d = aut->get_dict();
|
auto d = aut->get_dict();
|
||||||
|
|
||||||
tgba_digraph_ptr res = make_tgba_digraph(d);
|
twa_graph_ptr res = make_twa_graph(d);
|
||||||
res->copy_ap_of(aut);
|
res->copy_ap_of(aut);
|
||||||
res->prop_copy(aut, { true, true, false, false });
|
res->prop_copy(aut, { true, true, false, false });
|
||||||
res->copy_acceptance_of(aut);
|
res->copy_acceptance_of(aut);
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,6 @@ namespace spot
|
||||||
return props_exist.empty() && props_pos.empty() && props_neg.empty();
|
return props_exist.empty() && props_pos.empty() && props_neg.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr strip(const_tgba_digraph_ptr aut) const;
|
twa_graph_ptr strip(const_twa_graph_ptr aut) const;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
bool
|
bool
|
||||||
is_guarantee_automaton(const const_tgba_digraph_ptr& aut,
|
is_guarantee_automaton(const const_twa_graph_ptr& aut,
|
||||||
const scc_info* si)
|
const scc_info* si)
|
||||||
{
|
{
|
||||||
if (aut->acc().uses_fin_acceptance())
|
if (aut->acc().uses_fin_acceptance())
|
||||||
|
|
@ -70,7 +70,7 @@ namespace spot
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_safety_mwdba(const const_tgba_digraph_ptr& aut)
|
bool is_safety_mwdba(const const_twa_graph_ptr& aut)
|
||||||
{
|
{
|
||||||
if (!(aut->acc().is_buchi() || aut->acc().is_true()))
|
if (!(aut->acc().is_buchi() || aut->acc().is_true()))
|
||||||
throw std::runtime_error
|
throw std::runtime_error
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ namespace spot
|
||||||
/// \param sm an scc_info object for the automaton if available (it
|
/// \param sm an scc_info object for the automaton if available (it
|
||||||
/// will be built otherwise).
|
/// will be built otherwise).
|
||||||
SPOT_API bool
|
SPOT_API bool
|
||||||
is_guarantee_automaton(const const_tgba_digraph_ptr& aut,
|
is_guarantee_automaton(const const_twa_graph_ptr& aut,
|
||||||
const scc_info* sm = 0);
|
const scc_info* sm = 0);
|
||||||
|
|
||||||
/// \brief Whether a minimized WDBA represents a safety property.
|
/// \brief Whether a minimized WDBA represents a safety property.
|
||||||
|
|
@ -56,6 +56,6 @@ namespace spot
|
||||||
///
|
///
|
||||||
/// \param aut the automaton to check
|
/// \param aut the automaton to check
|
||||||
SPOT_API bool
|
SPOT_API bool
|
||||||
is_safety_mwdba(const const_tgba_digraph_ptr& aut);
|
is_safety_mwdba(const const_twa_graph_ptr& aut);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,12 +24,12 @@
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
tgba_digraph_ptr sbacc(tgba_digraph_ptr& old)
|
twa_graph_ptr sbacc(twa_graph_ptr& old)
|
||||||
{
|
{
|
||||||
if (old->has_state_based_acc())
|
if (old->has_state_based_acc())
|
||||||
return old;
|
return old;
|
||||||
|
|
||||||
auto res = make_tgba_digraph(old->get_dict());
|
auto res = make_twa_graph(old->get_dict());
|
||||||
res->copy_ap_of(old);
|
res->copy_ap_of(old);
|
||||||
res->copy_acceptance_of(old);
|
res->copy_acceptance_of(old);
|
||||||
res->prop_copy(old, {false, true, true, true});
|
res->prop_copy(old, {false, true, true, true});
|
||||||
|
|
|
||||||
|
|
@ -26,5 +26,5 @@ namespace spot
|
||||||
/// \brief Transform an automaton to use state-based acceptance
|
/// \brief Transform an automaton to use state-based acceptance
|
||||||
///
|
///
|
||||||
/// This is independent on the acceptance condition used.
|
/// This is independent on the acceptance condition used.
|
||||||
SPOT_API tgba_digraph_ptr sbacc(tgba_digraph_ptr& aut);
|
SPOT_API twa_graph_ptr sbacc(twa_graph_ptr& aut);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -248,14 +248,14 @@ namespace spot
|
||||||
|
|
||||||
|
|
||||||
template<class F, typename... Args>
|
template<class F, typename... Args>
|
||||||
tgba_digraph_ptr scc_filter_apply(const_tgba_digraph_ptr aut,
|
twa_graph_ptr scc_filter_apply(const_twa_graph_ptr aut,
|
||||||
scc_info* given_si, Args&&... args)
|
scc_info* given_si, Args&&... args)
|
||||||
{
|
{
|
||||||
if (!aut->acc().is_generalized_buchi())
|
if (!aut->acc().is_generalized_buchi())
|
||||||
throw std::runtime_error
|
throw std::runtime_error
|
||||||
("scc_filter() works only with generalized Büchi acceptance");
|
("scc_filter() works only with generalized Büchi acceptance");
|
||||||
|
|
||||||
tgba_digraph_ptr filtered = make_tgba_digraph(aut->get_dict());
|
twa_graph_ptr filtered = make_twa_graph(aut->get_dict());
|
||||||
unsigned in_n = aut->num_states(); // Number of input states.
|
unsigned in_n = aut->num_states(); // Number of input states.
|
||||||
if (in_n == 0) // Nothing to filter.
|
if (in_n == 0) // Nothing to filter.
|
||||||
return filtered;
|
return filtered;
|
||||||
|
|
@ -313,19 +313,19 @@ namespace spot
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
scc_filter_states(const const_tgba_digraph_ptr& aut, scc_info* given_si)
|
scc_filter_states(const const_twa_graph_ptr& aut, scc_info* given_si)
|
||||||
{
|
{
|
||||||
auto res = scc_filter_apply<state_filter<>>(aut, given_si);
|
auto res = scc_filter_apply<state_filter<>>(aut, given_si);
|
||||||
res->prop_copy(aut, { true, true, true, true });
|
res->prop_copy(aut, { true, true, true, true });
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
scc_filter(const const_tgba_digraph_ptr& aut, bool remove_all_useless,
|
scc_filter(const const_twa_graph_ptr& aut, bool remove_all_useless,
|
||||||
scc_info* given_si)
|
scc_info* given_si)
|
||||||
{
|
{
|
||||||
tgba_digraph_ptr res;
|
twa_graph_ptr res;
|
||||||
if (remove_all_useless)
|
if (remove_all_useless)
|
||||||
res = scc_filter_apply<state_filter
|
res = scc_filter_apply<state_filter
|
||||||
<acc_filter_all
|
<acc_filter_all
|
||||||
|
|
@ -344,12 +344,12 @@ namespace spot
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
scc_filter_susp(const const_tgba_digraph_ptr& aut, bool remove_all_useless,
|
scc_filter_susp(const const_twa_graph_ptr& aut, bool remove_all_useless,
|
||||||
bdd suspvars, bdd ignoredvars, bool early_susp,
|
bdd suspvars, bdd ignoredvars, bool early_susp,
|
||||||
scc_info* given_si)
|
scc_info* given_si)
|
||||||
{
|
{
|
||||||
tgba_digraph_ptr res;
|
twa_graph_ptr res;
|
||||||
if (remove_all_useless)
|
if (remove_all_useless)
|
||||||
res = scc_filter_apply<susp_filter
|
res = scc_filter_apply<susp_filter
|
||||||
<state_filter
|
<state_filter
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,8 @@ namespace spot
|
||||||
/// (i.e., transitions leaving accepting states are all marked as
|
/// (i.e., transitions leaving accepting states are all marked as
|
||||||
/// accepting) may destroy this property. Use scc_filter_states()
|
/// accepting) may destroy this property. Use scc_filter_states()
|
||||||
/// instead.
|
/// instead.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
scc_filter(const const_tgba_digraph_ptr& aut, bool remove_all_useless = false,
|
scc_filter(const const_twa_graph_ptr& aut, bool remove_all_useless = false,
|
||||||
scc_info* given_si = 0);
|
scc_info* given_si = 0);
|
||||||
|
|
||||||
/// \brief Prune unaccepting SCCs.
|
/// \brief Prune unaccepting SCCs.
|
||||||
|
|
@ -69,8 +69,8 @@ namespace spot
|
||||||
/// Especially, if the input TGBA has the SBA property, (i.e.,
|
/// Especially, if the input TGBA has the SBA property, (i.e.,
|
||||||
/// transitions leaving accepting states are all marked as
|
/// transitions leaving accepting states are all marked as
|
||||||
/// accepting), then the output TGBA will also have that property.
|
/// accepting), then the output TGBA will also have that property.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
scc_filter_states(const const_tgba_digraph_ptr& aut, scc_info* given_si = 0);
|
scc_filter_states(const const_twa_graph_ptr& aut, scc_info* given_si = 0);
|
||||||
|
|
||||||
/// \brief Prune unaccepting SCCs, superfluous acceptance
|
/// \brief Prune unaccepting SCCs, superfluous acceptance
|
||||||
/// sets, and suspension variables.
|
/// sets, and suspension variables.
|
||||||
|
|
@ -82,8 +82,8 @@ namespace spot
|
||||||
///
|
///
|
||||||
/// This is used by compsusp(), and is probably useless for any
|
/// This is used by compsusp(), and is probably useless for any
|
||||||
/// other use.
|
/// other use.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
scc_filter_susp(const const_tgba_digraph_ptr& aut, bool remove_all_useless,
|
scc_filter_susp(const const_twa_graph_ptr& aut, bool remove_all_useless,
|
||||||
bdd suspvars, bdd ignoredvars, bool early_susp,
|
bdd suspvars, bdd ignoredvars, bool early_susp,
|
||||||
scc_info* given_si = 0);
|
scc_info* given_si = 0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ namespace spot
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
scc_info::scc_info(const_tgba_digraph_ptr aut)
|
scc_info::scc_info(const_twa_graph_ptr aut)
|
||||||
: aut_(aut)
|
: aut_(aut)
|
||||||
{
|
{
|
||||||
unsigned n = aut->num_states();
|
unsigned n = aut->num_states();
|
||||||
|
|
@ -61,7 +61,7 @@ namespace spot
|
||||||
|
|
||||||
int num_; // Number of visited nodes, negated.
|
int num_; // Number of visited nodes, negated.
|
||||||
|
|
||||||
typedef tgba_digraph::graph_t::const_iterator iterator;
|
typedef twa_graph::graph_t::const_iterator iterator;
|
||||||
typedef std::pair<unsigned, iterator> pair_state_iter;
|
typedef std::pair<unsigned, iterator> pair_state_iter;
|
||||||
std::stack<pair_state_iter> todo_; // DFS stack. Holds (STATE,
|
std::stack<pair_state_iter> todo_; // DFS stack. Holds (STATE,
|
||||||
// ITERATOR) pairs where
|
// ITERATOR) pairs where
|
||||||
|
|
@ -299,7 +299,7 @@ namespace spot
|
||||||
|
|
||||||
std::ostream&
|
std::ostream&
|
||||||
dump_scc_info_dot(std::ostream& out,
|
dump_scc_info_dot(std::ostream& out,
|
||||||
const_tgba_digraph_ptr aut, scc_info* sccinfo)
|
const_twa_graph_ptr aut, scc_info* sccinfo)
|
||||||
{
|
{
|
||||||
scc_info* m = sccinfo ? sccinfo : new scc_info(aut);
|
scc_info* m = sccinfo ? sccinfo : new scc_info(aut);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ namespace spot
|
||||||
|
|
||||||
std::vector<unsigned> sccof_;
|
std::vector<unsigned> sccof_;
|
||||||
std::vector<scc_node> node_;
|
std::vector<scc_node> node_;
|
||||||
const_tgba_digraph_ptr aut_;
|
const_twa_graph_ptr aut_;
|
||||||
|
|
||||||
|
|
||||||
const scc_node& node(unsigned scc) const
|
const scc_node& node(unsigned scc) const
|
||||||
|
|
@ -120,9 +120,9 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
scc_info(const_tgba_digraph_ptr aut);
|
scc_info(const_twa_graph_ptr aut);
|
||||||
|
|
||||||
const_tgba_digraph_ptr get_aut() const
|
const_twa_graph_ptr get_aut() const
|
||||||
{
|
{
|
||||||
return aut_;
|
return aut_;
|
||||||
}
|
}
|
||||||
|
|
@ -226,6 +226,6 @@ namespace spot
|
||||||
/// If \a sccinfo is not given, it will be computed.
|
/// If \a sccinfo is not given, it will be computed.
|
||||||
SPOT_API std::ostream&
|
SPOT_API std::ostream&
|
||||||
dump_scc_info_dot(std::ostream& out,
|
dump_scc_info_dot(std::ostream& out,
|
||||||
const_tgba_digraph_ptr aut, scc_info* sccinfo = nullptr);
|
const_twa_graph_ptr aut, scc_info* sccinfo = nullptr);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -100,13 +100,13 @@ namespace spot
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
automaton_size(const tgba_digraph_ptr& a)
|
automaton_size(const twa_graph_ptr& a)
|
||||||
: transitions(a->num_transitions()),
|
: transitions(a->num_transitions()),
|
||||||
states(a->num_states())
|
states(a->num_states())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_size(const tgba_digraph_ptr& a)
|
void set_size(const twa_graph_ptr& a)
|
||||||
{
|
{
|
||||||
states = a->num_states();
|
states = a->num_states();
|
||||||
transitions = a->num_transitions();
|
transitions = a->num_transitions();
|
||||||
|
|
@ -171,7 +171,7 @@ namespace spot
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
acc_cond::mark_t bdd_to_mark(const tgba_digraph_ptr& aut, bdd b)
|
acc_cond::mark_t bdd_to_mark(const twa_graph_ptr& aut, bdd b)
|
||||||
{
|
{
|
||||||
// FIXME: Use a cache.
|
// FIXME: Use a cache.
|
||||||
std::vector<unsigned> res;
|
std::vector<unsigned> res;
|
||||||
|
|
@ -183,7 +183,7 @@ namespace spot
|
||||||
return aut->acc().marks(res.begin(), res.end());
|
return aut->acc().marks(res.begin(), res.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
direct_simulation(const const_tgba_digraph_ptr& in)
|
direct_simulation(const const_twa_graph_ptr& in)
|
||||||
: po_size_(0),
|
: po_size_(0),
|
||||||
all_class_var_(bddtrue),
|
all_class_var_(bddtrue),
|
||||||
original_(in)
|
original_(in)
|
||||||
|
|
@ -205,7 +205,7 @@ namespace spot
|
||||||
// (In the case of Cosimulation, we also flip the transitions.)
|
// (In the case of Cosimulation, we also flip the transitions.)
|
||||||
if (Cosimulation)
|
if (Cosimulation)
|
||||||
{
|
{
|
||||||
a_ = make_tgba_digraph(in->get_dict());
|
a_ = make_twa_graph(in->get_dict());
|
||||||
a_->copy_ap_of(in);
|
a_->copy_ap_of(in);
|
||||||
a_->copy_acceptance_of(in);
|
a_->copy_acceptance_of(in);
|
||||||
a_->new_states(ns);
|
a_->new_states(ns);
|
||||||
|
|
@ -242,7 +242,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
a_ = make_tgba_digraph(in, twa::prop_set::all());
|
a_ = make_twa_graph(in, twa::prop_set::all());
|
||||||
auto& acccond = a_->acc();
|
auto& acccond = a_->acc();
|
||||||
for (auto& t: a_->transitions())
|
for (auto& t: a_->transitions())
|
||||||
t.acc = acccond.comp(t.acc);
|
t.acc = acccond.comp(t.acc);
|
||||||
|
|
@ -341,7 +341,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
// The core loop of the algorithm.
|
// The core loop of the algorithm.
|
||||||
tgba_digraph_ptr run()
|
twa_graph_ptr run()
|
||||||
{
|
{
|
||||||
main_loop();
|
main_loop();
|
||||||
return build_result();
|
return build_result();
|
||||||
|
|
@ -481,9 +481,9 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build the minimal resulting automaton.
|
// Build the minimal resulting automaton.
|
||||||
tgba_digraph_ptr build_result()
|
twa_graph_ptr build_result()
|
||||||
{
|
{
|
||||||
tgba_digraph_ptr res = make_tgba_digraph(a_->get_dict());
|
twa_graph_ptr res = make_twa_graph(a_->get_dict());
|
||||||
res->copy_ap_of(a_);
|
res->copy_ap_of(a_);
|
||||||
res->copy_acceptance_of(a_);
|
res->copy_acceptance_of(a_);
|
||||||
if (Sba)
|
if (Sba)
|
||||||
|
|
@ -676,7 +676,7 @@ namespace spot
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// The automaton which is simulated.
|
// The automaton which is simulated.
|
||||||
tgba_digraph_ptr a_;
|
twa_graph_ptr a_;
|
||||||
|
|
||||||
// Relation is aimed to represent the same thing than
|
// Relation is aimed to represent the same thing than
|
||||||
// rel_. The difference is in the way it does.
|
// rel_. The difference is in the way it does.
|
||||||
|
|
@ -719,35 +719,35 @@ namespace spot
|
||||||
|
|
||||||
std::unique_ptr<scc_info> scc_info_;
|
std::unique_ptr<scc_info> scc_info_;
|
||||||
|
|
||||||
const const_tgba_digraph_ptr original_;
|
const const_twa_graph_ptr original_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End namespace anonymous.
|
} // End namespace anonymous.
|
||||||
|
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
simulation(const const_tgba_digraph_ptr& t)
|
simulation(const const_twa_graph_ptr& t)
|
||||||
{
|
{
|
||||||
direct_simulation<false, false> simul(t);
|
direct_simulation<false, false> simul(t);
|
||||||
return simul.run();
|
return simul.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
simulation_sba(const const_tgba_digraph_ptr& t)
|
simulation_sba(const const_twa_graph_ptr& t)
|
||||||
{
|
{
|
||||||
direct_simulation<false, true> simul(t);
|
direct_simulation<false, true> simul(t);
|
||||||
return simul.run();
|
return simul.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
cosimulation(const const_tgba_digraph_ptr& t)
|
cosimulation(const const_twa_graph_ptr& t)
|
||||||
{
|
{
|
||||||
direct_simulation<true, false> simul(t);
|
direct_simulation<true, false> simul(t);
|
||||||
return simul.run();
|
return simul.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
cosimulation_sba(const const_tgba_digraph_ptr& t)
|
cosimulation_sba(const const_twa_graph_ptr& t)
|
||||||
{
|
{
|
||||||
direct_simulation<true, true> simul(t);
|
direct_simulation<true, true> simul(t);
|
||||||
return simul.run();
|
return simul.run();
|
||||||
|
|
@ -755,10 +755,10 @@ namespace spot
|
||||||
|
|
||||||
|
|
||||||
template<bool Sba>
|
template<bool Sba>
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
iterated_simulations_(const const_tgba_digraph_ptr& t)
|
iterated_simulations_(const const_twa_graph_ptr& t)
|
||||||
{
|
{
|
||||||
tgba_digraph_ptr res = 0;
|
twa_graph_ptr res = 0;
|
||||||
automaton_size prev;
|
automaton_size prev;
|
||||||
automaton_size next;
|
automaton_size next;
|
||||||
|
|
||||||
|
|
@ -784,14 +784,14 @@ namespace spot
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
iterated_simulations(const const_tgba_digraph_ptr& t)
|
iterated_simulations(const const_twa_graph_ptr& t)
|
||||||
{
|
{
|
||||||
return iterated_simulations_<false>(t);
|
return iterated_simulations_<false>(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
iterated_simulations_sba(const const_tgba_digraph_ptr& t)
|
iterated_simulations_sba(const const_twa_graph_ptr& t)
|
||||||
{
|
{
|
||||||
return iterated_simulations_<true>(t);
|
return iterated_simulations_<true>(t);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,10 +67,10 @@ namespace spot
|
||||||
/// \param automaton the automaton to simulate.
|
/// \param automaton the automaton to simulate.
|
||||||
/// \return a new automaton which is at worst a copy of the received
|
/// \return a new automaton which is at worst a copy of the received
|
||||||
/// one
|
/// one
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
simulation(const const_tgba_digraph_ptr& automaton);
|
simulation(const const_twa_graph_ptr& automaton);
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
simulation_sba(const const_tgba_digraph_ptr& automaton);
|
simulation_sba(const const_twa_graph_ptr& automaton);
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// @{
|
/// @{
|
||||||
|
|
@ -120,10 +120,10 @@ namespace spot
|
||||||
/// \param automaton the automaton to simulate.
|
/// \param automaton the automaton to simulate.
|
||||||
/// \return a new automaton which is at worst a copy of the received
|
/// \return a new automaton which is at worst a copy of the received
|
||||||
/// one
|
/// one
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
cosimulation(const const_tgba_digraph_ptr& automaton);
|
cosimulation(const const_twa_graph_ptr& automaton);
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
cosimulation_sba(const const_tgba_digraph_ptr& automaton);
|
cosimulation_sba(const const_twa_graph_ptr& automaton);
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// @{
|
/// @{
|
||||||
|
|
@ -141,10 +141,10 @@ namespace spot
|
||||||
/// \param automaton the automaton to simulate.
|
/// \param automaton the automaton to simulate.
|
||||||
/// \return a new automaton which is at worst a copy of the received
|
/// \return a new automaton which is at worst a copy of the received
|
||||||
/// one
|
/// one
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
iterated_simulations(const const_tgba_digraph_ptr& automaton);
|
iterated_simulations(const const_twa_graph_ptr& automaton);
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
iterated_simulations_sba(const const_tgba_digraph_ptr& automaton);
|
iterated_simulations_sba(const const_twa_graph_ptr& automaton);
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
} // End namespace spot.
|
} // End namespace spot.
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream&
|
std::ostream&
|
||||||
stat_printer::print(const const_tgba_digraph_ptr& aut,
|
stat_printer::print(const const_twa_graph_ptr& aut,
|
||||||
const ltl::formula* f,
|
const ltl::formula* f,
|
||||||
double run_time)
|
double run_time)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ namespace spot
|
||||||
/// The \a f argument is not needed if the Formula does not need
|
/// The \a f argument is not needed if the Formula does not need
|
||||||
/// to be output, and so is \a run_time).
|
/// to be output, and so is \a run_time).
|
||||||
std::ostream&
|
std::ostream&
|
||||||
print(const const_tgba_digraph_ptr& aut, const ltl::formula* f = 0,
|
print(const const_twa_graph_ptr& aut, const ltl::formula* f = 0,
|
||||||
double run_time = -1.);
|
double run_time = -1.);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
void strip_acceptance_here(tgba_digraph_ptr a)
|
void strip_acceptance_here(twa_graph_ptr a)
|
||||||
{
|
{
|
||||||
unsigned n = a->num_states();
|
unsigned n = a->num_states();
|
||||||
for (unsigned s = 0; s < n; ++s)
|
for (unsigned s = 0; s < n; ++s)
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,9 @@
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
/// \ingroup tgba_misc
|
/// \ingroup tgba_misc
|
||||||
/// \brief Remove all acceptance sets from a tgba_digraph.
|
/// \brief Remove all acceptance sets from a twa_graph.
|
||||||
///
|
///
|
||||||
/// This is equivalent to marking all states/transitions as accepting.
|
/// This is equivalent to marking all states/transitions as accepting.
|
||||||
SPOT_API void
|
SPOT_API void
|
||||||
strip_acceptance_here(tgba_digraph_ptr a);
|
strip_acceptance_here(twa_graph_ptr a);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -281,7 +281,7 @@ namespace spot
|
||||||
typedef std::deque<stutter_state> queue_t;
|
typedef std::deque<stutter_state> queue_t;
|
||||||
|
|
||||||
static bdd
|
static bdd
|
||||||
get_all_ap(const const_tgba_digraph_ptr& a)
|
get_all_ap(const const_twa_graph_ptr& a)
|
||||||
{
|
{
|
||||||
bdd res = bddtrue;
|
bdd res = bddtrue;
|
||||||
for (auto& i: a->transitions())
|
for (auto& i: a->transitions())
|
||||||
|
|
@ -291,8 +291,8 @@ namespace spot
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
sl(const const_tgba_digraph_ptr& a, const ltl::formula* f)
|
sl(const const_twa_graph_ptr& a, const ltl::formula* f)
|
||||||
{
|
{
|
||||||
bdd aps = f
|
bdd aps = f
|
||||||
? atomic_prop_collect_as_bdd(f, a)
|
? atomic_prop_collect_as_bdd(f, a)
|
||||||
|
|
@ -300,8 +300,8 @@ namespace spot
|
||||||
return sl(a, aps);
|
return sl(a, aps);
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
sl2(const const_tgba_digraph_ptr& a, const ltl::formula* f)
|
sl2(const const_twa_graph_ptr& a, const ltl::formula* f)
|
||||||
{
|
{
|
||||||
bdd aps = f
|
bdd aps = f
|
||||||
? atomic_prop_collect_as_bdd(f, a)
|
? atomic_prop_collect_as_bdd(f, a)
|
||||||
|
|
@ -309,11 +309,11 @@ namespace spot
|
||||||
return sl2(a, aps);
|
return sl2(a, aps);
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
sl(const const_tgba_digraph_ptr& a, bdd atomic_propositions)
|
sl(const const_twa_graph_ptr& a, bdd atomic_propositions)
|
||||||
{
|
{
|
||||||
// The result automaton uses numbered states.
|
// The result automaton uses numbered states.
|
||||||
tgba_digraph_ptr res = make_tgba_digraph(a->get_dict());
|
twa_graph_ptr res = make_twa_graph(a->get_dict());
|
||||||
// We use the same BDD variables as the input.
|
// We use the same BDD variables as the input.
|
||||||
res->copy_ap_of(a);
|
res->copy_ap_of(a);
|
||||||
res->copy_acceptance_of(a);
|
res->copy_acceptance_of(a);
|
||||||
|
|
@ -373,8 +373,8 @@ namespace spot
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
sl2(tgba_digraph_ptr&& a, bdd atomic_propositions)
|
sl2(twa_graph_ptr&& a, bdd atomic_propositions)
|
||||||
{
|
{
|
||||||
if (atomic_propositions == bddfalse)
|
if (atomic_propositions == bddfalse)
|
||||||
atomic_propositions = get_all_ap(a);
|
atomic_propositions = get_all_ap(a);
|
||||||
|
|
@ -439,16 +439,16 @@ namespace spot
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
sl2(const const_tgba_digraph_ptr& a, bdd atomic_propositions)
|
sl2(const const_twa_graph_ptr& a, bdd atomic_propositions)
|
||||||
{
|
{
|
||||||
return sl2(make_tgba_digraph(a, twa::prop_set::all()),
|
return sl2(make_twa_graph(a, twa::prop_set::all()),
|
||||||
atomic_propositions);
|
atomic_propositions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
closure(tgba_digraph_ptr&& a)
|
closure(twa_graph_ptr&& a)
|
||||||
{
|
{
|
||||||
a->prop_keep({false, // state_based
|
a->prop_keep({false, // state_based
|
||||||
false, // inherently_weak
|
false, // inherently_weak
|
||||||
|
|
@ -529,10 +529,10 @@ namespace spot
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
closure(const const_tgba_digraph_ptr& a)
|
closure(const const_twa_graph_ptr& a)
|
||||||
{
|
{
|
||||||
return closure(make_tgba_digraph(a, {true, true, true, false}));
|
return closure(make_twa_graph(a, {true, true, true, false}));
|
||||||
}
|
}
|
||||||
|
|
||||||
// The stutter check algorithm to use can be overridden via an
|
// The stutter check algorithm to use can be overridden via an
|
||||||
|
|
@ -599,8 +599,8 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
is_stutter_invariant(tgba_digraph_ptr&& aut_f,
|
is_stutter_invariant(twa_graph_ptr&& aut_f,
|
||||||
tgba_digraph_ptr&& aut_nf, bdd aps, int algo)
|
twa_graph_ptr&& aut_nf, bdd aps, int algo)
|
||||||
{
|
{
|
||||||
if (algo == 0)
|
if (algo == 0)
|
||||||
algo = default_stutter_check_algorithm();
|
algo = default_stutter_check_algorithm();
|
||||||
|
|
|
||||||
|
|
@ -23,29 +23,29 @@
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
sl(const const_tgba_digraph_ptr&, const ltl::formula* = nullptr);
|
sl(const const_twa_graph_ptr&, const ltl::formula* = nullptr);
|
||||||
|
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
sl(const const_tgba_digraph_ptr&, bdd);
|
sl(const const_twa_graph_ptr&, bdd);
|
||||||
|
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
sl2(const const_tgba_digraph_ptr&, const ltl::formula* = nullptr);
|
sl2(const const_twa_graph_ptr&, const ltl::formula* = nullptr);
|
||||||
|
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
sl2(const const_tgba_digraph_ptr&, bdd);
|
sl2(const const_twa_graph_ptr&, bdd);
|
||||||
|
|
||||||
#ifndef SWIG
|
#ifndef SWIG
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
sl2(tgba_digraph_ptr&&, bdd = bddfalse);
|
sl2(twa_graph_ptr&&, bdd = bddfalse);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
closure(const const_tgba_digraph_ptr&);
|
closure(const const_twa_graph_ptr&);
|
||||||
|
|
||||||
#ifndef SWIG
|
#ifndef SWIG
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
closure(tgba_digraph_ptr&&);
|
closure(twa_graph_ptr&&);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// \ingroup ltl_misc
|
/// \ingroup ltl_misc
|
||||||
|
|
@ -54,7 +54,7 @@ namespace spot
|
||||||
is_stutter_invariant(const ltl::formula* f);
|
is_stutter_invariant(const ltl::formula* f);
|
||||||
|
|
||||||
SPOT_API bool
|
SPOT_API bool
|
||||||
is_stutter_invariant(tgba_digraph_ptr&& aut_f,
|
is_stutter_invariant(twa_graph_ptr&& aut_f,
|
||||||
tgba_digraph_ptr&& aut_nf, bdd aps,
|
twa_graph_ptr&& aut_nf, bdd aps,
|
||||||
int algo = 0);
|
int algo = 0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,8 @@ namespace spot
|
||||||
|
|
||||||
/// \brief Take an automaton with any acceptance condition and return
|
/// \brief Take an automaton with any acceptance condition and return
|
||||||
/// an equivalent Generalized Büchi automaton.
|
/// an equivalent Generalized Büchi automaton.
|
||||||
tgba_digraph_ptr
|
twa_graph_ptr
|
||||||
to_generalized_buchi(const const_tgba_digraph_ptr& aut)
|
to_generalized_buchi(const const_twa_graph_ptr& aut)
|
||||||
{
|
{
|
||||||
auto res = remove_fin(cleanup_acceptance(aut));
|
auto res = remove_fin(cleanup_acceptance(aut));
|
||||||
if (res->acc().is_generalized_buchi())
|
if (res->acc().is_generalized_buchi())
|
||||||
|
|
@ -81,7 +81,7 @@ namespace spot
|
||||||
if (cnf.size() == 2 && cnf.back().op == acc_cond::acc_op::Fin)
|
if (cnf.size() == 2 && cnf.back().op == acc_cond::acc_op::Fin)
|
||||||
{
|
{
|
||||||
assert(cnf.front().mark == 0U);
|
assert(cnf.front().mark == 0U);
|
||||||
res = make_tgba_digraph(aut->get_dict());
|
res = make_twa_graph(aut->get_dict());
|
||||||
res->set_init_state(res->new_state());
|
res->set_init_state(res->new_state());
|
||||||
res->prop_state_based_acc();
|
res->prop_state_based_acc();
|
||||||
res->prop_inherently_weak();
|
res->prop_inherently_weak();
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,6 @@ namespace spot
|
||||||
{
|
{
|
||||||
/// \brief Take an automaton with any acceptance condition and return
|
/// \brief Take an automaton with any acceptance condition and return
|
||||||
/// an equivalent Generalized Büchi automaton.
|
/// an equivalent Generalized Büchi automaton.
|
||||||
SPOT_API tgba_digraph_ptr
|
SPOT_API twa_graph_ptr
|
||||||
to_generalized_buchi(const const_tgba_digraph_ptr& aut);
|
to_generalized_buchi(const const_twa_graph_ptr& aut);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ namespace spot
|
||||||
simpl_owned_ = simpl_ = new ltl::ltl_simplifier(options, dict);
|
simpl_owned_ = simpl_ = new ltl::ltl_simplifier(options, dict);
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr translator::run(const ltl::formula** f)
|
twa_graph_ptr translator::run(const ltl::formula** f)
|
||||||
{
|
{
|
||||||
const ltl::formula* r = simpl_->simplify(*f);
|
const ltl::formula* r = simpl_->simplify(*f);
|
||||||
(*f)->destroy();
|
(*f)->destroy();
|
||||||
|
|
@ -71,7 +71,7 @@ namespace spot
|
||||||
// natural way (improving the degeneralization).
|
// natural way (improving the degeneralization).
|
||||||
simpl_->clear_as_bdd_cache();
|
simpl_->clear_as_bdd_cache();
|
||||||
|
|
||||||
tgba_digraph_ptr aut;
|
twa_graph_ptr aut;
|
||||||
if (comp_susp_ > 0)
|
if (comp_susp_ > 0)
|
||||||
{
|
{
|
||||||
int skel_wdba = skel_wdba_;
|
int skel_wdba = skel_wdba_;
|
||||||
|
|
@ -91,7 +91,7 @@ namespace spot
|
||||||
return aut;
|
return aut;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_digraph_ptr translator::run(const ltl::formula* f)
|
twa_graph_ptr translator::run(const ltl::formula* f)
|
||||||
{
|
{
|
||||||
f->clone();
|
f->clone();
|
||||||
auto aut = run(&f);
|
auto aut = run(&f);
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue