* src/tgbaalgos/gv04.cc (gv04): Inherit from ec_statistics.
(gv04::check, gv04::push, gv04::pop): Update the statistics for randtgba. (gv04::print_stats): Print them here too.
This commit is contained in:
parent
f965894a7f
commit
b0aab51580
2 changed files with 13 additions and 6 deletions
|
|
@ -1,5 +1,10 @@
|
||||||
2004-11-22 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
2004-11-22 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
||||||
|
|
||||||
|
* src/tgbaalgos/gv04.cc (gv04): Inherit from ec_statistics.
|
||||||
|
(gv04::check, gv04::push, gv04::pop): Update the statistics for
|
||||||
|
randtgba.
|
||||||
|
(gv04::print_stats): Print them here too.
|
||||||
|
|
||||||
* src/tgbaalgos/gtec/gtec.cc (couvreur99_check::check,
|
* src/tgbaalgos/gtec/gtec.cc (couvreur99_check::check,
|
||||||
couvreur99_check_shy::check): Compute more statistics for
|
couvreur99_check_shy::check): Compute more statistics for
|
||||||
randtgba.
|
randtgba.
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
#include "tgba/tgba.hh"
|
#include "tgba/tgba.hh"
|
||||||
#include "misc/hash.hh"
|
#include "misc/hash.hh"
|
||||||
#include "emptiness.hh"
|
#include "emptiness.hh"
|
||||||
|
#include "emptiness_stats.hh"
|
||||||
#include "gv04.hh"
|
#include "gv04.hh"
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
|
|
@ -51,7 +52,7 @@ namespace spot
|
||||||
int acc; // Accepting state link.
|
int acc; // Accepting state link.
|
||||||
};
|
};
|
||||||
|
|
||||||
struct gv04: public emptiness_check
|
struct gv04: public emptiness_check, public ec_statistics
|
||||||
{
|
{
|
||||||
// The automata to check.
|
// The automata to check.
|
||||||
const tgba* a;
|
const tgba* a;
|
||||||
|
|
@ -68,7 +69,6 @@ namespace spot
|
||||||
// Stack of visited states on the path.
|
// Stack of visited states on the path.
|
||||||
typedef std::vector<stack_entry> stack_type;
|
typedef std::vector<stack_entry> stack_type;
|
||||||
stack_type stack;
|
stack_type stack;
|
||||||
size_t max_stack_size;
|
|
||||||
|
|
||||||
int top; // Top of SCC stack.
|
int top; // Top of SCC stack.
|
||||||
int dftop; // Top of DFS stack.
|
int dftop; // Top of DFS stack.
|
||||||
|
|
@ -97,7 +97,6 @@ namespace spot
|
||||||
virtual emptiness_check_result*
|
virtual emptiness_check_result*
|
||||||
check()
|
check()
|
||||||
{
|
{
|
||||||
max_stack_size = 0;
|
|
||||||
top = dftop = -1;
|
top = dftop = -1;
|
||||||
violation = false;
|
violation = false;
|
||||||
push(a->get_init_state(), false);
|
push(a->get_init_state(), false);
|
||||||
|
|
@ -121,6 +120,7 @@ namespace spot
|
||||||
const state* s_prime = iter->current_state();
|
const state* s_prime = iter->current_state();
|
||||||
bool acc = iter->current_acceptance_conditions() == accepting;
|
bool acc = iter->current_acceptance_conditions() == accepting;
|
||||||
iter->next();
|
iter->next();
|
||||||
|
inc_transitions();
|
||||||
|
|
||||||
trace << " Next successor: s_prime = "
|
trace << " Next successor: s_prime = "
|
||||||
<< a->format_state(s_prime)
|
<< a->format_state(s_prime)
|
||||||
|
|
@ -153,6 +153,7 @@ namespace spot
|
||||||
delete s_prime;
|
delete s_prime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
set_states(h.size());
|
||||||
}
|
}
|
||||||
if (violation)
|
if (violation)
|
||||||
return new emptiness_check_result;
|
return new emptiness_check_result;
|
||||||
|
|
@ -182,8 +183,7 @@ namespace spot
|
||||||
|
|
||||||
stack.push_back(ss);
|
stack.push_back(ss);
|
||||||
dftop = top;
|
dftop = top;
|
||||||
|
inc_depth();
|
||||||
max_stack_size = std::max(max_stack_size, stack.size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -201,6 +201,7 @@ namespace spot
|
||||||
{
|
{
|
||||||
delete stack[i].nexttr;
|
delete stack[i].nexttr;
|
||||||
stack.pop_back();
|
stack.pop_back();
|
||||||
|
dec_depth();
|
||||||
}
|
}
|
||||||
top = dftop - 1;
|
top = dftop - 1;
|
||||||
}
|
}
|
||||||
|
|
@ -229,7 +230,8 @@ namespace spot
|
||||||
print_stats(std::ostream& os) const
|
print_stats(std::ostream& os) const
|
||||||
{
|
{
|
||||||
os << h.size() << " unique states visited" << std::endl;
|
os << h.size() << " unique states visited" << std::endl;
|
||||||
os << max_stack_size << " items max on stack" << std::endl;
|
os << transitions() << " transitions explored" << std::endl;
|
||||||
|
os << max_depth() << " items max on stack" << std::endl;
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue