Use bdd_implies() to speedup various algorithms.
* src/ltlvisit/simplify.cc, src/tgba/tgbaproduct.cc, src/tgba/tgbatba.cc, src/tgbaalgos/sccfilter.cc, src/tgbaalgos/simulation.cc: Here.
This commit is contained in:
parent
821d5e54b7
commit
484ea488c3
5 changed files with 13 additions and 21 deletions
|
|
@ -4140,15 +4140,9 @@ namespace spot
|
||||||
bool result;
|
bool result;
|
||||||
|
|
||||||
if (f->is_boolean() && g->is_boolean())
|
if (f->is_boolean() && g->is_boolean())
|
||||||
{
|
result = bdd_implies(as_bdd(f), as_bdd(g));
|
||||||
bdd l = as_bdd(f);
|
|
||||||
bdd r = as_bdd(g);
|
|
||||||
result = ((l & r) == l);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
result = syntactic_implication_aux(f, g);
|
result = syntactic_implication_aux(f, g);
|
||||||
}
|
|
||||||
|
|
||||||
// Cache result
|
// Cache result
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright (C) 2009, 2011 Laboratoire de Recherche et Développement
|
// Copyright (C) 2009, 2011, 2012 Laboratoire de Recherche et
|
||||||
// de l'Epita (LRDE).
|
// Développement de l'Epita (LRDE).
|
||||||
// Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de
|
// Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de
|
||||||
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||||
// Université Pierre et Marie Curie.
|
// Université Pierre et Marie Curie.
|
||||||
|
|
@ -319,7 +319,7 @@ namespace spot
|
||||||
{
|
{
|
||||||
assert(bdd_high(tmp) == bddfalse);
|
assert(bdd_high(tmp) == bddfalse);
|
||||||
int var = bdd_var(tmp);
|
int var = bdd_var(tmp);
|
||||||
if ((bdd_nithvar(var) & rna) == rna)
|
if (bdd_implies(rna, bdd_nithvar(var)))
|
||||||
{
|
{
|
||||||
int varclone = dict_->register_clone_acc(var, this);
|
int varclone = dict_->register_clone_acc(var, this);
|
||||||
bdd_setpair(right_common_acc_, var, varclone);
|
bdd_setpair(right_common_acc_, var, varclone);
|
||||||
|
|
|
||||||
|
|
@ -241,11 +241,11 @@ namespace spot
|
||||||
--prev;
|
--prev;
|
||||||
bdd common = aut->
|
bdd common = aut->
|
||||||
common_acceptance_conditions_of_original_state(rs);
|
common_acceptance_conditions_of_original_state(rs);
|
||||||
if ((common & *prev) == *prev)
|
if (bdd_implies(*prev, common))
|
||||||
{
|
{
|
||||||
bdd u = aut->
|
bdd u = aut->
|
||||||
union_acceptance_conditions_of_original_state(odest);
|
union_acceptance_conditions_of_original_state(odest);
|
||||||
if ((u & *prev) != *prev)
|
if (!bdd_implies(*prev, u))
|
||||||
acc -= *prev;
|
acc -= *prev;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -279,7 +279,7 @@ namespace spot
|
||||||
// acceptance sets common to the outgoing transition of
|
// acceptance sets common to the outgoing transition of
|
||||||
// the destination state.
|
// the destination state.
|
||||||
acc |= otheracc;
|
acc |= otheracc;
|
||||||
while (next != cycle.end() && (acc & *next) == *next)
|
while (next != cycle.end() && bdd_implies(*next, acc))
|
||||||
++next;
|
++next;
|
||||||
if (next != cycle.end())
|
if (next != cycle.end())
|
||||||
{
|
{
|
||||||
|
|
@ -291,7 +291,7 @@ namespace spot
|
||||||
accepting = true;
|
accepting = true;
|
||||||
// Skip as much acceptance conditions as we can on our cycle.
|
// Skip as much acceptance conditions as we can on our cycle.
|
||||||
next = cycle.begin();
|
next = cycle.begin();
|
||||||
while (next != expected && (acc & *next) == *next)
|
while (next != expected && bdd_implies(*next, acc))
|
||||||
++next;
|
++next;
|
||||||
next_is_set:
|
next_is_set:
|
||||||
state_tba_proxy* dest =
|
state_tba_proxy* dest =
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (C) 2009, 2010, 2011 Laboratoire de Recherche et
|
// Copyright (C) 2009, 2010, 2011, 2012 Laboratoire de Recherche et
|
||||||
// Développement de l'Epita (LRDE).
|
// Développement de l'Epita (LRDE).
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
|
|
@ -142,8 +142,7 @@ namespace spot
|
||||||
// and we want to find that 'a' and 'b' are useless because
|
// and we want to find that 'a' and 'b' are useless because
|
||||||
// they always occur with 'c'.
|
// they always occur with 'c'.
|
||||||
// The way we check if 'a' is useless that is to look whether
|
// The way we check if 'a' is useless that is to look whether
|
||||||
// USEFUL & (x -> a) == USEFUL for some other acceptance
|
// USEFUL implies (x -> a) for some other acceptance condition x.
|
||||||
// condition x.
|
|
||||||
bdd allconds = bdd_support(negall);
|
bdd allconds = bdd_support(negall);
|
||||||
bdd allcondscopy = allconds;
|
bdd allcondscopy = allconds;
|
||||||
bdd useless = bddtrue;
|
bdd useless = bddtrue;
|
||||||
|
|
@ -157,7 +156,7 @@ namespace spot
|
||||||
bdd x = bdd_ithvar(bdd_var(others));
|
bdd x = bdd_ithvar(bdd_var(others));
|
||||||
if (x != a)
|
if (x != a)
|
||||||
{
|
{
|
||||||
if ((useful & (x >> a)) == useful)
|
if (bdd_implies(useful, x >> a))
|
||||||
{
|
{
|
||||||
// a is useless
|
// a is useless
|
||||||
useful = bdd_exist(useful, a);
|
useful = bdd_exist(useful, a);
|
||||||
|
|
|
||||||
|
|
@ -411,8 +411,7 @@ namespace spot
|
||||||
if (it1 == it2)
|
if (it1 == it2)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// We detect that "a&b -> a" by testing "a&b = a".
|
if (bdd_implies(it1->first, it2->first))
|
||||||
if ((it1->first & it2->first) == (it1->first))
|
|
||||||
{
|
{
|
||||||
accu &= it2->second;
|
accu &= it2->second;
|
||||||
++po_size_;
|
++po_size_;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue