partial_degeneralization: generalize to terms that contain todegen

* spot/twaalgos/degen.cc: Implement this.
* tests/python/pdegen.py: Add tests.
This commit is contained in:
Alexandre Duret-Lutz 2020-02-04 13:47:44 +01:00
parent b733d486be
commit 8df616ee0d
2 changed files with 91 additions and 15 deletions

View file

@ -767,10 +767,14 @@ namespace spot
SPOT_FALLTHROUGH;
case acc_cond::acc_op::Inf:
case acc_cond::acc_op::InfNeg:
pos -= 2;
if (code[pos].mark != todegen)
tostrip -= code[pos].mark;
break;
{
pos -= 2;
acc_cond::mark_t m = code[pos].mark;
if (todegen.subset(m))
m -= todegen;
tostrip -= m;
break;
}
}
}
while (pos > 0);
@ -812,17 +816,21 @@ namespace spot
SPOT_FALLTHROUGH;
case acc_cond::acc_op::Inf:
case acc_cond::acc_op::InfNeg:
pos -= 2;
if (code[pos].mark == todegen)
{
code[pos].mark = accmark;
updated = true;
}
else
{
code[pos].mark = code[pos].mark.strip(tostrip);
}
break;
{
pos -= 2;
acc_cond::mark_t m = code[pos].mark;
if (todegen.subset(m))
{
m -= todegen;
code[pos].mark = m.strip(tostrip) | accmark;
updated = true;
}
else
{
code[pos].mark = m.strip(tostrip);
}
break;
}
}
}
while (pos > 0);