satmin: ignore (s,l,d2) if (s,l,d1) is already in result

* src/tgbaalgos/dtbasat.cc, src/tgbaalgos/dtgbasat.cc: Here.
This commit is contained in:
Alexandre Duret-Lutz 2013-09-11 14:36:08 +02:00
parent 90a466d6a3
commit b318b151c8
2 changed files with 85 additions and 21 deletions

View file

@ -95,6 +95,32 @@ namespace spot
}
};
struct src_cond
{
int src;
bdd cond;
src_cond(int src, bdd cond)
: src(src), cond(cond)
{
}
bool operator<(const src_cond& other) const
{
if (this->src < other.src)
return true;
if (this->src > other.src)
return false;
return this->cond.id() < other.cond.id();
}
bool operator==(const src_cond& other) const
{
return (this->src == other.src
&& this->cond.id() == other.cond.id());
}
};
struct state_pair
{
int a;
@ -678,6 +704,7 @@ namespace spot
dout << "--- transition variables ---\n";
std::set<int> acc_states;
std::set<src_cond> seen_trans;
for (sat_solution::const_iterator i = solution.begin();
i != solution.end(); ++i)
{
@ -693,6 +720,10 @@ namespace spot
dict::rev_map::const_iterator t = satdict.revtransid.find(v);
if (t != satdict.revtransid.end())
{
// Skip (s,l,d2) if we have already seen some (s,l,d1).
if (seen_trans.insert(src_cond(t->second.src,
t->second.cond)).second)
{
last_aut_trans = a->create_transition(t->second.src,
t->second.dst);
@ -706,6 +737,7 @@ namespace spot
&& acc_states.find(t->second.src) != acc_states.end())
last_aut_trans->acceptance_conditions = acc;
}
}
else
{
t = satdict.revtransacc.find(v);

View file

@ -96,6 +96,32 @@ namespace spot
}
};
struct src_cond
{
int src;
bdd cond;
src_cond(int src, bdd cond)
: src(src), cond(cond)
{
}
bool operator<(const src_cond& other) const
{
if (this->src < other.src)
return true;
if (this->src > other.src)
return false;
return this->cond.id() < other.cond.id();
}
bool operator==(const src_cond& other) const
{
return (this->src == other.src
&& this->cond.id() == other.cond.id());
}
};
struct transition_acc
{
int src;
@ -875,6 +901,7 @@ namespace spot
dout << "--- transition variables ---\n";
std::map<int, bdd> state_acc;
std::set<src_cond> seen_trans;
for (sat_solution::const_iterator i = solution.begin();
i != solution.end(); ++i)
{
@ -890,6 +917,10 @@ namespace spot
dict::rev_map::const_iterator t = satdict.revtransid.find(v);
if (t != satdict.revtransid.end())
{
// Skip (s,l,d2) if we have already seen some (s,l,d1).
if (seen_trans.insert(src_cond(t->second.src,
t->second.cond)).second)
{
last_aut_trans = a->create_transition(t->second.src,
t->second.dst);
@ -906,6 +937,7 @@ namespace spot
last_aut_trans->acceptance_conditions = i->second;
}
}
}
else
{
dict::rev_acc_map::const_iterator ta;