Fix non determinism in the simulation.
* src/tgbaalgos/simulation.cc: Fix non determinism. * src/tgbatest/simdet.test: Test that the behavior is now correct. * src/tgbatest/Makefile.am (TESTS): Add the new test to the test-suite.
This commit is contained in:
parent
49d384b1eb
commit
d10e772d35
3 changed files with 55 additions and 6 deletions
|
|
@ -147,8 +147,10 @@ namespace spot
|
|||
map_state_unsigned::const_iterator i = state2int.find(s);
|
||||
if (i == state2int.end())
|
||||
{
|
||||
i = state2int.insert(std::make_pair(s, ++current_max)).first;
|
||||
previous_class_[out_->add_state(current_max)] = bddfalse;
|
||||
i = state2int.insert(std::make_pair(s, ++current_max)).first;
|
||||
const state* to_add = out_->add_state(current_max);
|
||||
previous_class_[to_add] = bddfalse;
|
||||
order_.push_back(to_add);
|
||||
}
|
||||
return i->second;
|
||||
}
|
||||
|
|
@ -192,6 +194,7 @@ namespace spot
|
|||
size_t size;
|
||||
tgba_explicit_number* out_;
|
||||
map_state_bdd previous_class_;
|
||||
std::list<const state*> order_;
|
||||
|
||||
private:
|
||||
const tgba* ea_;
|
||||
|
|
@ -262,6 +265,8 @@ namespace spot
|
|||
}
|
||||
|
||||
relation_[init] = init;
|
||||
|
||||
order_ = acc_compl.order_;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -369,11 +374,11 @@ namespace spot
|
|||
// all the reachable states of this automaton. We do not
|
||||
// have to make (again) a traversal. We just have to run
|
||||
// through this map.
|
||||
for (map_state_bdd::iterator it = previous_class_.begin();
|
||||
it != previous_class_.end();
|
||||
++it)
|
||||
for (std::list<const state*>::const_iterator it = order_.begin();
|
||||
it != order_.end();
|
||||
++it)
|
||||
{
|
||||
const state* src = it->first;
|
||||
const state* src = previous_class_.find(*it)->first;
|
||||
|
||||
bdd_lstate_[compute_sig(src)].push_back(src);
|
||||
}
|
||||
|
|
@ -711,6 +716,9 @@ namespace spot
|
|||
state* initial_state;
|
||||
|
||||
automaton_size stat;
|
||||
|
||||
// The order of the state.
|
||||
std::list<const state*> order_;
|
||||
};
|
||||
|
||||
} // End namespace anonymous.
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ tripprod_SOURCES = tripprod.cc
|
|||
# because such failures will be easier to diagnose and fix.
|
||||
TESTS = \
|
||||
intvcomp.test \
|
||||
simdet.test \
|
||||
eltl2tgba.test \
|
||||
explicit.test \
|
||||
explicit2.test \
|
||||
|
|
|
|||
40
src/tgbatest/simdet.test
Executable file
40
src/tgbatest/simdet.test
Executable file
|
|
@ -0,0 +1,40 @@
|
|||
#! /bin/sh
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2012 Laboratoire de Recherche et Développement
|
||||
# de l'Epita (LRDE).
|
||||
#
|
||||
# This file is part of Spot, a model checking library.
|
||||
#
|
||||
# Spot is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Spot is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
# License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
. ./defs
|
||||
set -e
|
||||
|
||||
run 0 ../ltl2tgba -R3 -RIS \
|
||||
'G("P_1.p2" <-> (F"P_1.p3" & ("P_0.p3" | (X"P_1.CS" U "P_1.p2")))) U G"P_1.p2"'\
|
||||
> exp
|
||||
run 0 ../ltl2tgba -R3 -RIS \
|
||||
'G("P_1.p2" <-> (F"P_1.p3" & ("P_0.p3" | (X"P_1.CS" U "P_1.p2")))) U G"P_1.p2"'\
|
||||
> out
|
||||
|
||||
diff exp out
|
||||
|
||||
run 0 ../ltl2tgba -R3 -RIS \
|
||||
'G("P_1.p2" <-> (F"P_1.p3" & ("P_0.p3" | (X"P_1.CS" U "P_1.p2")))) U G"P_1.p2"'\
|
||||
> out
|
||||
|
||||
diff exp out
|
||||
|
||||
rm exp out
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue