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:
parent
c7f4b8e262
commit
83e7f0fa18
14 changed files with 726 additions and 34 deletions
|
|
@ -34,6 +34,7 @@ namespace spot
|
|||
{
|
||||
index = i;
|
||||
is_accepting = false;
|
||||
condition = bddfalse;
|
||||
}
|
||||
|
||||
scc_stack_ta::connected_component&
|
||||
|
|
|
|||
22
src/ta/ta.hh
22
src/ta/ta.hh
|
|
@ -70,7 +70,6 @@ namespace spot
|
|||
virtual bool
|
||||
is_livelock_accepting_state(const spot::state* s) const = 0;
|
||||
|
||||
|
||||
virtual bool
|
||||
is_initial_state(const spot::state* s) const = 0;
|
||||
|
||||
|
|
@ -80,6 +79,16 @@ namespace spot
|
|||
virtual void
|
||||
free_state(const spot::state* s) const = 0;
|
||||
|
||||
/// \brief Return the set of all acceptance conditions used
|
||||
/// by this automaton.
|
||||
///
|
||||
/// The goal of the emptiness check is to ensure that
|
||||
/// a strongly connected component walks through each
|
||||
/// of these acceptiong conditions. I.e., the union
|
||||
/// of the acceptiong conditions of all transition in
|
||||
/// the SCC should be equal to the result of this function.
|
||||
virtual bdd all_acceptance_conditions() const = 0;
|
||||
|
||||
};
|
||||
|
||||
/// Successor iterators used by spot::ta.
|
||||
|
|
@ -107,11 +116,8 @@ namespace spot
|
|||
is_stuttering_transition() const = 0;
|
||||
|
||||
bdd
|
||||
current_acceptance_conditions() const
|
||||
{
|
||||
assert(!done());
|
||||
return bddfalse;
|
||||
}
|
||||
current_acceptance_conditions() const = 0;
|
||||
|
||||
};
|
||||
|
||||
// A stack of Strongly-Connected Components
|
||||
|
|
@ -128,6 +134,10 @@ namespace spot
|
|||
|
||||
bool is_accepting;
|
||||
|
||||
/// The bdd condition is the union of all acceptance conditions of
|
||||
/// transitions which connect the states of the connected component.
|
||||
bdd condition;
|
||||
|
||||
std::list<state*> rem;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -83,6 +83,13 @@ namespace spot
|
|||
return (*i_)->condition;
|
||||
}
|
||||
|
||||
bdd
|
||||
ta_explicit_succ_iterator::current_acceptance_conditions() const
|
||||
{
|
||||
assert(!done());
|
||||
return (*i_)->acceptance_conditions;
|
||||
}
|
||||
|
||||
bool
|
||||
ta_explicit_succ_iterator::is_stuttering_transition() const
|
||||
{
|
||||
|
|
@ -138,6 +145,10 @@ namespace spot
|
|||
!= transitions_condition->end() && !transition_found); it_trans++)
|
||||
{
|
||||
transition_found = ((*it_trans)->dest == t->dest);
|
||||
if (transition_found)
|
||||
{
|
||||
(*it_trans)->acceptance_conditions |= t->acceptance_conditions;
|
||||
}
|
||||
}
|
||||
|
||||
if (!transition_found)
|
||||
|
|
@ -313,9 +324,10 @@ namespace spot
|
|||
// ta_explicit
|
||||
|
||||
|
||||
ta_explicit::ta_explicit(const tgba* tgba_,
|
||||
ta_explicit::ta_explicit(const tgba* tgba, bdd all_acceptance_conditions,
|
||||
state_ta_explicit* artificial_initial_state) :
|
||||
tgba_(tgba_), artificial_initial_state_(artificial_initial_state)
|
||||
tgba_(tgba), all_acceptance_conditions_(all_acceptance_conditions),
|
||||
artificial_initial_state_(artificial_initial_state)
|
||||
{
|
||||
get_dict()->register_all_variables_of(&tgba_, this);
|
||||
if (artificial_initial_state != 0)
|
||||
|
|
@ -341,6 +353,7 @@ namespace spot
|
|||
delete tgba_;
|
||||
}
|
||||
|
||||
|
||||
state_ta_explicit*
|
||||
ta_explicit::add_state(state_ta_explicit* s)
|
||||
{
|
||||
|
|
@ -386,6 +399,19 @@ namespace spot
|
|||
state_ta_explicit::transition* t = new state_ta_explicit::transition;
|
||||
t->dest = dest;
|
||||
t->condition = condition;
|
||||
t->acceptance_conditions = bddfalse;
|
||||
source->add_transition(t);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
ta_explicit::create_transition(state_ta_explicit* source, bdd condition,
|
||||
bdd acceptance_conditions, state_ta_explicit* dest)
|
||||
{
|
||||
state_ta_explicit::transition* t = new state_ta_explicit::transition;
|
||||
t->dest = dest;
|
||||
t->condition = condition;
|
||||
t->acceptance_conditions = acceptance_conditions;
|
||||
source->add_transition(t);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ namespace spot
|
|||
class ta_explicit : public ta
|
||||
{
|
||||
public:
|
||||
ta_explicit(const tgba* tgba_, state_ta_explicit* artificial_initial_state =
|
||||
0);
|
||||
ta_explicit(const tgba* tgba, bdd all_acceptance_conditions,
|
||||
state_ta_explicit* artificial_initial_state = 0);
|
||||
|
||||
const tgba*
|
||||
get_tgba() const;
|
||||
|
|
@ -57,6 +57,10 @@ namespace spot
|
|||
create_transition(state_ta_explicit* source, bdd condition,
|
||||
state_ta_explicit* dest);
|
||||
|
||||
void
|
||||
create_transition(state_ta_explicit* source, bdd condition,
|
||||
bdd acceptance_conditions, state_ta_explicit* dest);
|
||||
|
||||
void
|
||||
delete_stuttering_transitions();
|
||||
// ta interface
|
||||
|
|
@ -114,16 +118,32 @@ namespace spot
|
|||
return states_set_;
|
||||
}
|
||||
|
||||
/// \brief Return the set of all acceptance conditions used
|
||||
/// by this automaton.
|
||||
///
|
||||
/// The goal of the emptiness check is to ensure that
|
||||
/// a strongly connected component walks through each
|
||||
/// of these acceptiong conditions. I.e., the union
|
||||
/// of the acceptiong conditions of all transition in
|
||||
/// the SCC should be equal to the result of this function.
|
||||
bdd
|
||||
all_acceptance_conditions() const
|
||||
{
|
||||
return all_acceptance_conditions_;;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
// Disallow copy.
|
||||
ta_explicit(const ta_explicit& other);
|
||||
ta_explicit&
|
||||
operator=(const ta_explicit& other);
|
||||
|
||||
const tgba* tgba_;
|
||||
bdd all_acceptance_conditions_;
|
||||
state_ta_explicit* artificial_initial_state_;
|
||||
ta::states_set_t states_set_;
|
||||
ta::states_set_t initial_states_set_;
|
||||
const tgba* tgba_;
|
||||
state_ta_explicit* artificial_initial_state_;
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -136,6 +156,7 @@ namespace spot
|
|||
struct transition
|
||||
{
|
||||
bdd condition;
|
||||
bdd acceptance_conditions;
|
||||
state_ta_explicit* dest;
|
||||
};
|
||||
|
||||
|
|
@ -201,6 +222,8 @@ namespace spot
|
|||
void
|
||||
free_transitions();
|
||||
|
||||
|
||||
|
||||
private:
|
||||
const state* tgba_state_;
|
||||
const bdd tgba_condition_;
|
||||
|
|
@ -232,6 +255,9 @@ namespace spot
|
|||
virtual bdd
|
||||
current_condition() const;
|
||||
|
||||
virtual bdd
|
||||
current_acceptance_conditions() const;
|
||||
|
||||
virtual bool
|
||||
is_stuttering_transition() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -190,6 +190,7 @@ namespace spot
|
|||
//if stuttering transition, the TA automata stays in the same state
|
||||
current_state_ = new state_ta_product(source_->get_ta_state(),
|
||||
kripke_current_dest_state->clone());
|
||||
current_acceptance_conditions_ = bddfalse;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -197,6 +198,8 @@ namespace spot
|
|||
{
|
||||
current_state_ = new state_ta_product(ta_succ_it_->current_state(),
|
||||
kripke_current_dest_state->clone());
|
||||
current_acceptance_conditions_
|
||||
= ta_succ_it_->current_acceptance_conditions();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -249,6 +252,19 @@ namespace spot
|
|||
return current_condition_;
|
||||
}
|
||||
|
||||
bdd
|
||||
ta_succ_iterator_product::current_acceptance_conditions() const
|
||||
{
|
||||
// assert(!done());
|
||||
// bdd kripke_source_condition = kripke_->state_condition(source_->get_kripke_state());
|
||||
// state * kripke_succ_it_current_state = kripke_succ_it_->current_state();
|
||||
// bdd kripke_current_dest_condition = kripke_->state_condition(kripke_succ_it_current_state);
|
||||
// delete kripke_succ_it_current_state;
|
||||
// return bdd_setxor(kripke_source_condition, kripke_current_dest_condition);
|
||||
|
||||
return current_acceptance_conditions_;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// ta_product
|
||||
|
||||
|
|
@ -392,6 +408,12 @@ namespace spot
|
|||
return is_hole_state;
|
||||
}
|
||||
|
||||
bdd
|
||||
ta_product::all_acceptance_conditions() const
|
||||
{
|
||||
return get_ta()->all_acceptance_conditions();
|
||||
}
|
||||
|
||||
bdd
|
||||
ta_product::get_state_condition(const spot::state* s) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -97,6 +97,9 @@ namespace spot
|
|||
bdd
|
||||
current_condition() const;
|
||||
|
||||
bdd
|
||||
current_acceptance_conditions() const;
|
||||
|
||||
bool
|
||||
is_stuttering_transition() const;
|
||||
|
||||
|
|
@ -121,6 +124,7 @@ namespace spot
|
|||
tgba_succ_iterator* kripke_succ_it_;
|
||||
state_ta_product* current_state_;
|
||||
bdd current_condition_;
|
||||
bdd current_acceptance_conditions_;
|
||||
bool is_stuttering_transition_;
|
||||
bdd kripke_source_condition;
|
||||
state * kripke_current_dest_state;
|
||||
|
|
@ -173,10 +177,12 @@ namespace spot
|
|||
virtual bool
|
||||
is_hole_state_in_ta_component(const spot::state* s) const;
|
||||
|
||||
|
||||
virtual bdd
|
||||
get_state_condition(const spot::state* s) const;
|
||||
|
||||
virtual bdd
|
||||
all_acceptance_conditions() const;
|
||||
|
||||
virtual void
|
||||
free_state(const spot::state* s) const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue