Commit graph

14 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
fca6513604 simulation: fix merging transiant SCCs
This fixes #452, and also fix a bug related to transiant SCCs
incorrectly merged in cosimulation: the source of the edges was
updated without fixing the chaining of the edges.

* spot/twaalgos/simulation.cc: Fix all the above.
* tests/python/simstate.py: Add test case from issue #452.
* tests/core/det.test, tests/core/ltlsynt.test,
tests/core/satmin.test: Lower expected sizes.
* tests/python/decompose.ipynb: Adjust for changed order.
2021-04-19 23:38:50 +02:00
Alexandre Duret-Lutz
2a38328a5c replace bdd_satoneset(x,y,bddtrue) loops by minterms_of(x,y)
Because the loops iterate in the opposite order, multiple
test cases need to be adjusted.

* spot/taalgos/tgba2ta.cc, spot/twaalgos/alternation.cc,
spot/twaalgos/dualize.cc, spot/twaalgos/ltl2tgba_fm.cc,
spot/twaalgos/simulation.cc, spot/twaalgos/stutter.cc,
spot/twaalgos/toweak.cc: Replace loops based on
bdd_satonest(x,y,bddtrue) by loops based on minterms_of(x,y).
* tests/core/degenscc.test, tests/core/dualize.test,
tests/core/genltl.test, tests/core/readsave.test,
tests/python/alternation.ipynb, tests/python/automata.ipynb,
tests/python/decompose.ipynb, tests/python/decompose_scc.py,
tests/python/dualize.py, tests/python/sccinfo.py,
tests/python/simstate.py, tests/python/testingaut.ipynb,
tests/python/word.ipynb: Adjust expected test cases.  The
only regression is in genltl.test, but the worsened case
should eventually be fixed as discussed in issue #425 anyway.
2021-04-14 17:31:45 +02:00
Jerome Dubois
fb066ada0a simulation: Add simulation based reduction
* spot/twaalgos/simulation.hh, spot/twaalgos/simulation.cc: Add
  reduce_direct_sim(), reduce_direct_cosim() and
  reduce_direct_iterated() wich reduce an automaton using simulation.
  This functions wrap the class direct_sim wich compute simulation
  with a new method.
* doc/spot.bib: Add ref.
* tests/python/simstate.py: Add tests for the new simulation.
2021-03-29 11:25:56 +02:00
Alexandre Duret-Lutz
2072151499 twa_graph: swap the two passes of merge_edges()
This improves the determinism in a few cases.

* spot/twa/twagraph.cc (merge_edges): Encapsulate the two
passes into lambdas so that they are very easy to swap.
* spot/twa/twagraph.hh (merge_edges): Adjust documentation.
* tests/python/mergedge.py: Add test case.
* tests/core/alternating.test, tests/python/alternation.ipynb:
Determinism was improved.
* tests/core/parity2.test, tests/core/readsave.test,
tests/core/sbacc.test, tests/python/_product_susp.ipynb,
tests/python/atva16-fig2a.ipynb, tests/python/decompose.ipynb,
tests/python/highlighting.ipynb, tests/python/satmin.ipynb,
tests/python/simstate.py: Adjust expected order of edges.
* NEWS: Mention the change.
2021-01-20 00:16:12 +01:00
Alexandre Duret-Lutz
1c5468a93a simplify: fix handling of keep_top_xor
Under that option, !(a ^ b) was converted
to (!a <=> !b) instead of simply (a <=> b).

* spot/tl/simplify.cc (equiv_or_xor): Improve
rewriting.
* tests/core/ltl2tgba2.test, tests/python/simstate.py: Adjust test
cases.
2020-07-22 17:02:22 +02:00
Alexandre Duret-Lutz
6bfa9793d6 translate: improve handling of Xor and Equiv at top-level for -G -D
* spot/tl/formula.hh: Add variant of formula::is that support 4
arguments.
* spot/tl/simplify.hh, spot/tl/simplify.cc: Add option keep_top_xor
to preserve Xor and Equiv at the top-level.
* spot/twaalgos/translate.cc: Adjust ltl-split to deal with Xor and
Equiv for the -D -G case.
* NEWS: Mention that.
* tests/core/ltl2tgba2.test: Add test case.
* tests/python/simstate.py: Adjust expected result.
2020-05-16 18:19:26 +02:00
Alexandre Duret-Lutz
b733d486be fix degeneralize_tba after accepting transition
* spot/twaalgos/degen.cc (degeneralize_tba): Here.
* tests/python/pdegen.py, tests/python/simstate.py: Adjust expected
values.
* NEWS: Mention the bug.
2020-02-03 15:38:51 +01:00
Maximilien Colange
41d5e44914 Slight improvement of the determinization
* spot/twaalgos/determinize.cc: the acceptance condition
  of the determinized automaton should be simpler
* tests/core/safra.test, tests/python/simstate.py: update tests
2018-02-21 18:20:57 +01:00
Maximilien Colange
bd739a5712 Heavily rewrite and optimize the determinization
* NEWS: document the rewrite
* spot/twaalgos/determinize.cc: lots of code optimizations
* tests/core/safra.test, tests/python/highlighting.ipynb,
  tests/python/simstate.py: Update tests
2017-10-19 14:17:55 +02:00
Alexandre Duret-Lutz
5e5a69488e twa_graph: do not order BDDs by IDs in merge_edges()
Fixes #282.

* spot/misc/bddlt.hh (bdd_less_than_stable): New function.
* spot/twa/twagraph.cc (merge_edges): Use it.
* tests/core/genltl.test: Adjust, and add an extra test
for the behavior of #282.
* tests/core/complement.test, tests/core/degenid.test,
tests/core/ltldo.test, tests/core/prodor.test,
tests/core/readsave.test, tests/core/sbacc.test,
tests/python/atva16-fig2a.ipynb, tests/python/automata.ipynb,
tests/python/decompose.ipynb, tests/python/dualize.py,
tests/python/highlighting.ipynb, tests/python/piperead.ipynb,
tests/python/product.ipynb, tests/python/simstate.py,
tests/python/tra2tba.py: Adjust all expected outputs.
* NEWS: Mention the bug.
2017-09-24 16:47:49 +02:00
Maximilien Colange
4f8a8f7305 Properly handle "simulated-states" property in twagraph::defrag_states.
* spot/twa/twagraph.cc: Implement the change.
* spot/twaalgos/simulation.hh: Improve documentation.
* tests/python/simstate.py: Improve the test.
* doc/org/concepts.org: Typo.
2017-06-05 15:48:36 +02:00
Alexandre Duret-Lutz
9ab4b840fd simulation: do not depend on bdd numbers for ordering classes
Fixes #262 again.  Reported by Maximilien Colange.

* spot/twaalgos/simulation.cc: Use state numbers to order classes, not
their signatures.  The problem was that even if two simulation of the
same automaton assign the same signature, the BDD identifier used for
that signature might be different, and therefore the ordering obtained
by using BDDs as keys in a map can be different.  A side-effect of
this change is that the order of states in automata produced by
simulation-based reduction may change; many tests had to be updated.
* tests/core/ltl2tgba.test: Add a new test case based on Maximilien's
report.
* tests/core/complement.test, tests/core/det.test,
tests/core/parseaut.test, tests/core/prodor.test, tests/core/scc.test,
tests/python/atva16-fig2a.ipynb, tests/python/automata.ipynb,
tests/python/decompose.ipynb, tests/python/decompose_scc.py,
tests/python/highlighting.ipynb, tests/python/piperead.ipynb,
tests/python/sccinfo.py, tests/python/simstate.py,
tests/python/testingaut.ipynb, tests/python/word.ipynb: Update
test case for new order of states.
2017-06-02 14:10:34 +02:00
Maximilien Colange
f7d14ab526 Degeneralization keeps track of levels.
* NEWS: Document this.
* spot/twa/twagraph.cc: `copy_state_names_from` handles this new info.
* spot/twaalgos/degen.hh, spot/twaalgos/degen.cc: Implement it.
* tests/python/origstate.py, tests/python/simstate.py: Update tests to
  reflect the change.
2017-05-31 13:28:42 +02:00
Maximilien Colange
7b5ab54530 Simulation keeps track of simulated states in the input automaton.
* NEWS: Document the change.
* spot/twaalgos/simulation.cc: Implement the change.
* spot/twa/twagraph.cc: `copy_state_names_from` uses simulated states
  info if present.
* spot/twaalgos/determinize.cc: Pretty-print in determinization follows
  simulated states, avoiding possible confusion.
* tests/Makefile.am, tests/python/simstate.py: Add a test.
2017-05-31 13:28:41 +02:00