Commit dc7ca7d8 authored by Etienne Renault's avatar Etienne Renault

Force Clang and GCC to have the same behaviour.

* src/ltlvisit/remove_x.cc, src/ltltest/remove_x.test: here.
parent 43951773
......@@ -38,3 +38,11 @@ run 0 ../../bin/ltlfilt --remove-x -f 'F(!a & Xb)' > out
grep -v X out
# The output is stutter invariant, even if the input wasn't.
run 0 ../../bin/ltlfilt -q --stutter-invariant -F 'out'
# Ensure remove_x does not depend on clang or gcc recursive calls
echo 'F(a & ((a & (a U (!a & b)) & ((!b U !a) | (b U !a))) |'\
' (!a & (!a U (a & !a & b)) & ((!b U a) | (b U a))) | (b & (b U (!a & b & !b))'\
' & ((!a U !b) | (a U !b))) | (!b & (!b U (!a & b)) & ((!a U b) | (a U b)))'\
' | (!a & b & (G!a | Ga) & (G!b | Gb))))' > expected
run 0 ../../bin/ltlfilt --remove-x -f 'F(a & X(!a & b))' > 'out'
diff expected out
......@@ -75,8 +75,12 @@ namespace spot
for (atomic_prop_set::const_iterator j = aps.begin();
j != aps.end(); ++j)
if (*j != *i)
va1->push_back(OR(U((*j)->clone(), npi->clone()),
U(NOT((*j)->clone()), npi->clone())));
{
// make sure the arguments of OR are created in a
// deterministic order
auto tmp = U(NOT((*j)->clone()), npi->clone());
va1->push_back(OR(U((*j)->clone(), npi->clone()), tmp));
}
vo->push_back(multop::instance(multop::And, va1));
// Second line
multop::vec* va2 = new multop::vec;
......@@ -85,8 +89,12 @@ namespace spot
for (atomic_prop_set::const_iterator j = aps.begin();
j != aps.end(); ++j)
if (*j != *i)
va2->push_back(OR(U((*j)->clone(), (*i)->clone()),
U(NOT((*j)->clone()), (*i)->clone())));
{
// make sure the arguments of OR are created in a
// deterministic order
auto tmp = U(NOT((*j)->clone()), (*i)->clone());
va2->push_back(OR(U((*j)->clone(), (*i)->clone()), tmp));
}
vo->push_back(multop::instance(multop::And, va2));
}
const formula* l12 = multop::instance(multop::Or, vo);
......@@ -95,8 +103,10 @@ namespace spot
for (atomic_prop_set::const_iterator i = aps.begin();
i != aps.end(); ++i)
{
va3->push_back(OR(G((*i)->clone()),
G(NOT((*i)->clone()))));
// make sure the arguments of OR are created in a
// deterministic order
auto tmp = G(NOT((*i)->clone()));
va3->push_back(OR(G((*i)->clone()), tmp));
}
result_ = OR(l12, AND(multop::instance(multop::And, va3), c));
return;
......
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