* src/ltlvisit/reduce.cc (reduce): Repeat the reduction as

long as the formula changes, it makes more sense when
combining algorithm.  E.g. basic reductions can help language
containment and vice-versa.
This commit is contained in:
Alexandre Duret-Lutz 2007-04-29 08:31:13 +00:00
parent f57097b991
commit 5d8727258d
2 changed files with 52 additions and 38 deletions

View file

@ -1,3 +1,10 @@
2007-04-29 Alexandre Duret-Lutz <adl@gnu.org>
* src/ltlvisit/reduce.cc (reduce): Repeat the reduction as
long as the formula changes, it makes more sense when
combining algorithm. E.g. basic reductions can help language
containment and vice-versa.
2007-04-20 Alexandre Duret-Lutz <adl@gnu.org> 2007-04-20 Alexandre Duret-Lutz <adl@gnu.org>
* src/tgbatest/spotlbtt.test: Disable formula rewriting during * src/tgbatest/spotlbtt.test: Disable formula rewriting during

View file

@ -1,6 +1,6 @@
// Copyright (C) 2004, 2006 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004, 2006, 2007 Laboratoire d'Informatique de Paris 6
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // (LIP6), département Systèmes Répartis Coopératifs (SRC),
// et Marie Curie. // Université Pierre et Marie Curie.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -296,7 +296,23 @@ namespace spot
{ {
formula* f1; formula* f1;
formula* f2; formula* f2;
formula* prev = 0;
int n = 0;
while (f != prev)
{
++n;
assert(n < 100);
if (prev)
{
destroy(prev);
prev = const_cast<formula*>(f);
}
else
{
prev = clone(f);
}
f1 = unabbreviate_logic(f); f1 = unabbreviate_logic(f);
f2 = simplify_f_g(f1); f2 = simplify_f_g(f1);
destroy(f1); destroy(f1);
@ -319,31 +335,22 @@ namespace spot
f1 = v.result(); f1 = v.result();
destroy(f2); destroy(f2);
f2 = f1; f2 = f1;
// Run basic_reduce again.
//
// Consider `FG b & g' were g is an eventual formula rewritten
// as `g = FG c' Then basic_reduce with rewrite it
// as FG(b & c).
if (opt & Reduce_Basics)
{
f1 = basic_reduce(f2);
destroy(f2);
f2 = f1;
}
} }
if (opt & (Reduce_Containment_Checks if (opt & (Reduce_Containment_Checks
| Reduce_Containment_Checks_Stronger)) | Reduce_Containment_Checks_Stronger))
{ {
formula* f1 = reduce_tau03(f2, formula* f1 =
reduce_tau03(f2,
opt & Reduce_Containment_Checks_Stronger); opt & Reduce_Containment_Checks_Stronger);
destroy(f2); destroy(f2);
f2 = f1; f2 = f1;
} }
f = f2;
return f2; }
destroy(prev);
return const_cast<formula*>(f);
} }
} }
} }