GTA (Generalized Testing Automata) implementation

* src/ta/ta.cc, src/ta/ta.hh, src/ta/taexplicit.cc,
src/ta/taexplicit.hh, src/ta/taproduct.cc, src/ta/taproduct.hh,
src/taalgos/Makefile.am, src/taalgos/dotty.cc,
src/taalgos/emptinessta.cc, src/taalgos/minimize.cc,
src/taalgos/minimize.hh, src/taalgos/tgba2ta.cc, src/taalgos/tgba2ta.hh,
src/tgbatest/ltl2tgba.cc: changes introduced to add a new form of TA
called GTA (Generalized Testing Automata). GTA is a TA with acceptance-
conditions added on transitions.
This commit is contained in:
Ala-Eddine Ben-Salem 2011-07-05 21:26:22 +02:00 committed by Alexandre Duret-Lutz
parent c7f4b8e262
commit 83e7f0fa18
14 changed files with 726 additions and 34 deletions

View file

@ -30,6 +30,7 @@
#include "emptinessta.hh"
#include "misc/memusage.hh"
#include <math.h>
#include "tgba/bddprint.hh"
namespace spot
{
@ -51,6 +52,12 @@ namespace spot
// We use five main data in this algorithm:
// * scc: a stack of strongly connected components (SCC)
scc;
// * arc, a stack of acceptance conditions between each of these SCC,
std::stack<bdd> arc;
// * h: a hash of all visited nodes, with their order,
// (it is called "Hash" in Couvreur's paper)
numbered_state_heap* h =
@ -108,6 +115,7 @@ namespace spot
h->insert(init, ++num);
scc.push(num);
arc.push(bddfalse);
ta_succ_iterator* iter = a_->succ_iter(init);
iter->first();
@ -187,6 +195,9 @@ namespace spot
}
dec_depth(scc.rem().size());
scc.pop();
assert(!arc.empty());
arc.pop();
}
delete succ;
@ -201,6 +212,8 @@ namespace spot
// Fetch the values destination state we are interested in...
state* dest = succ->current_state();
bdd acc_cond = succ->current_acceptance_conditions();
bool curr_is_livelock_hole_state_in_ta_component =
(a_->is_hole_state_in_ta_component(curr))
&& a_->is_livelock_accepting_state(curr);
@ -228,6 +241,7 @@ namespace spot
// for later processing.
h->insert(dest, ++num);
scc.push(num);
arc.push(acc_cond);
ta_succ_iterator* iter = a_->succ_iter(dest);
iter->first();
@ -265,13 +279,18 @@ namespace spot
while (threshold < scc.top().index)
{
assert(!scc.empty());
assert(!arc.empty());
acc |= scc.top().is_accepting;
acc_cond |= scc.top().condition;
acc_cond |= arc.top();
rem.splice(rem.end(), scc.rem());
scc.pop();
arc.pop();
}
// Note that we do not always have
// threshold == scc.top().index
// after this loop, the SSCC whose index is threshold might have
@ -279,13 +298,23 @@ namespace spot
// Accumulate all acceptance conditions into the merged SSCC.
scc.top().is_accepting |= acc;
scc.top().condition |= acc_cond;
scc.rem().splice(scc.rem().end(), rem);
if (scc.top().is_accepting)
bool is_accepting_sscc = (scc.top().is_accepting)
|| (scc.top().condition == a_->all_acceptance_conditions());
if (is_accepting_sscc)
{
clear(h, todo, init_set);
trace
<< "PASS 1: SUCCESS" << std::endl;
trace
<< "PASS 1: scc.top().condition : " << bdd_format_accset(a_->get_dict(),
scc.top().condition) << std::endl;
trace
<< "PASS 1: a_->all_acceptance_conditions() : " << bdd_format_accset(a_->get_dict(),
a_->all_acceptance_conditions()) << std::endl;
return true;
}