zlktree: use a cache in the construction of zielonka_tree
This largely speeds up the computation for conditions like "Rabin n" sharing a lot of subtrees. Also implement options to stop the construction if the shape is wrong. * spot/twaalgos/zlktree.cc, spot/twaalgos/zlktree.hh: Implement the cache and the options. * tests/python/zlktree.ipynb, tests/python/zlktree.py: New tests.
This commit is contained in:
parent
f784e40548
commit
b11208440b
5 changed files with 517 additions and 151 deletions
File diff suppressed because one or more lines are too long
|
|
@ -152,3 +152,12 @@ tc.assertTrue(a.equivalent_to(b))
|
|||
b = spot.acd_transform_sbacc(a, False)
|
||||
tc.assertEqual(str(b.acc()), '(2, Fin(0) & Inf(1))')
|
||||
tc.assertTrue(a.equivalent_to(b))
|
||||
|
||||
|
||||
# This used to be very slow.
|
||||
c = spot.acc_cond("Rabin 9")
|
||||
n = spot.zielonka_tree(c).num_branches()
|
||||
tc.assertEqual(n, 362880)
|
||||
opt = spot.zielonka_tree_options_MERGE_SUBTREES;
|
||||
n = spot.zielonka_tree(c, opt).num_branches()
|
||||
tc.assertEqual(n, 9)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue