sat-minimize: generalize to any acceptance
This is still missing tests. * src/bin/autfilt.cc: Add a --sat-minimize option. * src/misc/optionmap.cc, src/misc/optionmap.hh: Allow passing strings. * src/twa/acc.cc, src/twa/acc.hh: Add helper functions needed by the SAT-encoder. * src/twaalgos/complete.hh: Typos. * src/twaalgos/dtbasat.hh: Adjust comment. * src/twaalgos/dtgbasat.cc, src/twaalgos/dtgbasat.hh: Generalize to take the target acceptance as input. * src/twaalgos/postproc.cc, src/tests/ltl2tgba.cc: Adjust calls. * src/twaalgos/sbacc.cc, src/twaalgos/sbacc.hh: Don't pass the pointer by reference. * src/tests/acc.cc, src/tests/acc.test: More tests for the acceptance helper function.
This commit is contained in:
parent
19a273929c
commit
0874980574
15 changed files with 419 additions and 147 deletions
|
|
@ -34,6 +34,25 @@ void check(spot::acc_cond& ac, spot::acc_cond::mark_t m)
|
|||
std::cout << '\n';
|
||||
}
|
||||
|
||||
void print(const std::vector<std::vector<int>>& res)
|
||||
{
|
||||
for (auto& v: res)
|
||||
{
|
||||
std::cout << '{';
|
||||
const char* comma = "";
|
||||
for (int s: v)
|
||||
{
|
||||
std::cout << comma;
|
||||
if (s < 0)
|
||||
std::cout << '!' << (-s - 1);
|
||||
else
|
||||
std::cout << s;
|
||||
comma = ", ";
|
||||
}
|
||||
std::cout << "}\n";
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
spot::acc_cond ac(4);
|
||||
|
|
@ -128,6 +147,16 @@ int main()
|
|||
code3.append_and(ac.fin({2, 3}));
|
||||
std::cout << code3.size() << ' ' << code3 << ' ' << code3.is_dnf() << '\n';
|
||||
|
||||
// code3 == (Fin(2)|Fin(3)) & (Inf(0)&Inf(1))
|
||||
// {0}
|
||||
// {1}
|
||||
// {2, 3}
|
||||
std::cout << code3 << ' ' << "{0} true\n";
|
||||
spot::acc_cond::mark_t m = 0U;
|
||||
m.set(0);
|
||||
print(code3.missing(m, true));
|
||||
std::cout << code3 << ' ' << "{0} false\n";
|
||||
print(code3.missing(m, false));
|
||||
|
||||
std::cout << spot::parse_acc_code("t") << '\n';
|
||||
std::cout << spot::parse_acc_code("f") << '\n';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue