* src/tgbaalgos/emptiness_stats.hh (accs_statistics): New class.
* src/tgbaalgos/gtec/ce.cc, src/tgbaalgos/gtec/ce.hh (couvreur99_check_result): Inherit from acss_statistics. (couvreur99_check_result::acss_states): Implement it. * src/tgbatest/randtgba.cc: Display statistics about accepting cycle search space.
This commit is contained in:
parent
13183893dd
commit
ca2fe6c711
5 changed files with 165 additions and 48 deletions
|
|
@ -33,42 +33,58 @@ namespace spot
|
|||
public :
|
||||
ec_statistics()
|
||||
: states_(0), transitions_(0), depth_(0), max_depth_(0)
|
||||
{
|
||||
}
|
||||
void set_states(int n)
|
||||
{
|
||||
states_ = n;
|
||||
}
|
||||
void inc_states()
|
||||
{
|
||||
++states_;
|
||||
}
|
||||
void inc_transitions()
|
||||
{
|
||||
++transitions_;
|
||||
}
|
||||
void inc_depth()
|
||||
{
|
||||
++depth_;
|
||||
if (depth_ > max_depth_)
|
||||
max_depth_ = depth_;
|
||||
}
|
||||
void dec_depth()
|
||||
{
|
||||
--depth_;
|
||||
}
|
||||
int states() const
|
||||
{
|
||||
return states_;
|
||||
}
|
||||
int transitions() const
|
||||
{
|
||||
return transitions_;
|
||||
}
|
||||
int max_depth() const
|
||||
{
|
||||
return max_depth_;
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
set_states(int n)
|
||||
{
|
||||
states_ = n;
|
||||
}
|
||||
|
||||
void
|
||||
inc_states()
|
||||
{
|
||||
++states_;
|
||||
}
|
||||
|
||||
void
|
||||
inc_transitions()
|
||||
{
|
||||
++transitions_;
|
||||
}
|
||||
|
||||
void
|
||||
inc_depth()
|
||||
{
|
||||
++depth_;
|
||||
if (depth_ > max_depth_)
|
||||
max_depth_ = depth_;
|
||||
}
|
||||
|
||||
void
|
||||
dec_depth()
|
||||
{
|
||||
--depth_;
|
||||
}
|
||||
|
||||
int
|
||||
states() const
|
||||
{
|
||||
return states_;
|
||||
}
|
||||
|
||||
int
|
||||
transitions() const
|
||||
{
|
||||
return transitions_;
|
||||
}
|
||||
|
||||
int
|
||||
max_depth() const
|
||||
{
|
||||
return max_depth_;
|
||||
}
|
||||
|
||||
private :
|
||||
unsigned states_; /// number of disctint visited states
|
||||
|
|
@ -77,6 +93,13 @@ namespace spot
|
|||
unsigned max_depth_; /// maximal depth of the stack(s)
|
||||
};
|
||||
|
||||
/// Accepting Cycle Search Space statistics
|
||||
class acss_statistics
|
||||
{
|
||||
public:
|
||||
virtual int acss_states() const = 0;
|
||||
};
|
||||
|
||||
/// @}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
// et Marie Curie.
|
||||
//
|
||||
|
|
@ -78,6 +78,19 @@ namespace spot
|
|||
{
|
||||
}
|
||||
|
||||
int
|
||||
couvreur99_check_result::acss_states() const
|
||||
{
|
||||
int count = 0;
|
||||
int scc_root = ecs_->root.s.top().index;
|
||||
|
||||
numbered_state_heap_const_iterator* i = ecs_->h->iterator();
|
||||
for (i->first(); !i->done(); i->next())
|
||||
if (i->get_index() >= scc_root)
|
||||
++count;
|
||||
return count;
|
||||
}
|
||||
|
||||
tgba_run*
|
||||
couvreur99_check_result::accepting_run()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
// et Marie Curie.
|
||||
//
|
||||
|
|
@ -24,11 +24,14 @@
|
|||
|
||||
#include "status.hh"
|
||||
#include "tgbaalgos/emptiness.hh"
|
||||
#include "tgbaalgos/emptiness_stats.hh"
|
||||
|
||||
namespace spot
|
||||
{
|
||||
/// Compute a counter example from a spot::couvreur99_check_status
|
||||
class couvreur99_check_result: public emptiness_check_result
|
||||
class couvreur99_check_result:
|
||||
public emptiness_check_result,
|
||||
public acss_statistics
|
||||
{
|
||||
public:
|
||||
couvreur99_check_result(const couvreur99_check_status* ecs);
|
||||
|
|
@ -37,6 +40,8 @@ namespace spot
|
|||
|
||||
void print_stats(std::ostream& os) const;
|
||||
|
||||
virtual int acss_states() const;
|
||||
|
||||
protected:
|
||||
/// Called by accepting_run() to find a cycle which traverses all
|
||||
/// acceptance conditions in the accepted SCC.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue