Commit d47aa1d8 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

DVE2: Do not display state variables with only one possible value.

* iface/dve2/dve2.cc (dve2_kripke::dve2_kripke): Fill
a format_filter_ array with boolean indicating whether each
variable should be printed.  Ignore variable with only one
possible value.
(dve2_kripke::~dve2_kripke): Destroy it.
(dve2_kripke::format_state): Use it.
* iface/dve2/finite.test: Adjust.
parent 866af2a7
2011-06-06 Alexandre Duret-Lutz <adl@lrde.epita.fr>
DVE2: Do not display state variables with only one possible value.
* iface/dve2/dve2.cc (dve2_kripke::dve2_kripke): Fill
a format_filter_ array with boolean indicating whether each
variable should be printed. Ignore variable with only one
possible value.
(dve2_kripke::~dve2_kripke): Destroy it.
(dve2_kripke::format_state): Use it.
* iface/dve2/finite.test: Adjust.
2011-06-06 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Remove Kristin Rozier's LTLcounter.pl scripts, now that we can
......
......@@ -612,8 +612,17 @@ namespace spot
state_condition_last_state_(0), state_condition_last_cc_(0)
{
vname_ = new const char*[state_size_];
format_filter_ = new bool[state_size_];
for (int i = 0; i < state_size_; ++i)
vname_[i] = d_->get_state_variable_name(i);
{
vname_[i] = d_->get_state_variable_name(i);
// We don't want to print variables that can take a single
// value (e.g. process with a single state) to shorten the
// output.
int type = d->get_state_variable_type(i);
format_filter_[i] =
(d->get_state_variable_type_value_count(type) != 1);
}
// Register the "dead" proposition. There are three cases to
// consider:
......@@ -648,6 +657,7 @@ namespace spot
~dve2_kripke()
{
delete[] format_filter_;
delete[] vname_;
if (compress_)
{
......@@ -866,6 +876,11 @@ namespace spot
int i = 0;
for (;;)
{
if (!format_filter_[i])
{
++i;
continue;
}
res << vname_[i] << "=" << vars[i];
++i;
if (i == state_size_)
......@@ -886,6 +901,7 @@ namespace spot
int state_size_;
bdd_dict* dict_;
const char** vname_;
bool* format_filter_;
const prop_set* ps_;
bdd alive_prop;
bdd dead_prop;
......
......@@ -34,19 +34,19 @@ fi
set -e
run 0 ../dve2check -gm $srcdir/finite.dve '"P.a < 10"' > stdout
test "`grep ' -> ' stdout | wc -l`" = 25
test "`grep 'P=0' stdout | wc -l`" = 15
test "`grep 'P.a=' stdout | wc -l`" = 15
run 0 ../dve2check -dtrue -gm $srcdir/finite.dve '"P.a < 10"' > stdout2
cmp stdout stdout2
run 0 ../dve2check -dfalse -gm $srcdir/finite.dve '"P.a < 10"' > stdout
test "`grep ' -> ' stdout | wc -l`" = 19
test "`grep 'P=0' stdout | wc -l`" = 15
test "`grep 'P.a=' stdout | wc -l`" = 15
# the same with compressed states
run 0 ../dve2check -z -dfalse -gm $srcdir/finite.dve '"P.a < 10"' > stdout
test "`grep ' -> ' stdout | wc -l`" = 19
test "`grep 'P=0' stdout | wc -l`" = 15
test "`grep 'P.a=' stdout | wc -l`" = 15
run 0 ../dve2check -ddead -e $srcdir/finite.dve \
'!(G(dead -> ("P.a==3" | "P.b==3")))'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment