Commit graph

442 commits

Author SHA1 Message Date
philipp
17db582341 Making aiger a class
Aiger circuits noew have their own class.
Monitors can be translated to and obtained
from aiger circuits.
Moreover a step by step evaluation method
is provided.

* spot/twaalgos/aiger.hh,
spot/twaalgos/aiger.cc: Here
* bin/ltlsynt.cc: Adopt new modes
* tests/core/ltlsynt.test: Adapt tests
* python/spot/impl.i: Add python support
* tests/Makefile.am,
tests/python/aiger.py: New test cases
2021-09-16 14:53:46 +02:00
Alexandre Duret-Lutz
9539fbcf4c genem: implement the logic from the future journal version of ATVA19
This version of the generic emptiness-check, using smart selection and
extraction of the Fin (implemented here via fin_one_extract), was
suggested by Jan Strejček on 2020-06-26.

* spot/twaalgos/genem.cc, spot/twaalgos/genem.hh: Add the spot210
variant.  Also use it for the ACD use-case.
* spot/twaalgos/zlktree.cc (zielonka_tree): Also use the same logic
here.
* tests/python/genem.py: Test the new version as well.
2021-09-11 01:08:15 +02:00
Alexandre Duret-Lutz
7fedb3dc61 acc: introduce fin_one_extract()
* spot/twa/acc.cc, spot/twa/acc.hh (acc_cond::fin_one_extract,
acc_code::acc_cond::fin_one_extract): New methods.
* python/spot/impl.i: Add support for the return type.
* tests/python/acc_cond.ipynb: Test them.
2021-09-11 01:00:38 +02:00
Alexandre Duret-Lutz
cb1f6b1239 acc: introduce inf_unit()
* spot/twa/acc.cc, spot/twa/acc.hh: Here.
* tests/python/setacc.py: Test it.
2021-09-08 17:12:05 +02:00
Alexandre Duret-Lutz
4ed5160fb8 zlktree: fix a bug
Reported by Florian.

* spot/twaalgos/zlktree.cc: Handle the case where the condition does
not cover all colors.
* tests/python/zlktree.py: New file.
* tests/Makefile.am: Add it.
2021-09-08 15:15:08 +02:00
Alexandre Duret-Lutz
ceec447617 * tests/python/zlktree.ipynb: Fix the steps through the example. 2021-09-07 13:54:43 +02:00
Alexandre Duret-Lutz
170d839c4b acd: remove redundant nodes
Reported by Florian Renkin.

* spot/twaalgos/zlktree.cc (acd::_build): Use a sorted list to remove
redundant children, has done in zielonka_tree.
* tests/python/zlktree.ipynb: Add Florian's test case.
* tests/python/toparity.py: Adjust, and revert some tests
uncommented by mistake in a previous patch.
2021-09-05 20:50:33 +02:00
Alexandre Duret-Lutz
5c5790039b zlktree: cleanup the interface, and add interactive ACD
* tests/python/_zlktree.ipynb: Remove and replace by...
* tests/python/zlktree.ipynb: ... this more documented notebook.
* tests/Makefile.am: Adjust.
* doc/org/tut.org, NEWS: Mention zlktree.ipynb.
* spot/twaalgos/zlktree.hh, spot/twaalgos/zlktree.cc,
python/spot/__init__.py: Cleanup interface, and add support for
interactive display.
2021-09-04 12:48:57 +02:00
Alexandre Duret-Lutz
1de441e8e5 tests: work around issue #474
* tests/python/_autparserr.ipynb: Redirect stderr to /dev/null
for some commands.
2021-09-01 12:27:21 +02:00
Alexandre Duret-Lutz
86c22d98bc zlktree: remimplement zielonka_tree without BDDs
* spot/twaalgos/zlktree.cc (zielonka_tree): Find the models using a
recursive procedure on the acceptance condition, without conversion to
BDD.
* tests/python/_zlktree.ipynb: Adjust to a different order of nodes.
2021-09-01 12:00:53 +02:00
Alexandre Duret-Lutz
26f2179805 zlktree: implement ACD and its transform
A quick and dirty implementation of the Alternating Cycle
Decomposition of the casares.21.icalp paper.

* spot/twaalgos/genem.cc, spot/twaalgos/genem.hh
(maximal_accepting_loops_for_scc): New function.
* spot/twaalgos/sccinfo.cc,
spot/twaalgos/sccinfo.hh (scc_and_mark_filter): Add a possibility to
specify a mask of transition to filter.
* spot/twaalgos/zlktree.hh, spot/twaalgos/zlktree.cc (acd): New class.
(acd_transform): New function.
* python/spot/__init__.py: Add SVG rendering for acd.
* tests/python/_zlktree.ipynb: Play with acd and acd_transform.
* tests/python/toparity.py: Add more tests to compare the
sizes of acd_transform and to_parity.
* NEWS: Mention this new feature.
2021-08-30 10:27:06 +02:00
Alexandre Duret-Lutz
8c5bb6c2eb zlktree: add a paritization based on zielonka trees
* spot/twaalgos/zlktree.hh,
spot/twaalgos/zlktree.cc (zielonka_tree_transform): New function.
* tests/python/_zlktree.ipynb: Test it on three examples.
2021-08-30 10:27:06 +02:00
Alexandre Duret-Lutz
af511707c0 introduce a zielonka_tree class
* spot/twaalgos/zlktree.cc, spot/twaalgos/zlktree.hh: New files.
* spot/twaalgos/Makefile.am: Add them.
* tests/python/_zlktree.ipynb: New file.
* tests/Makefile.am: Add it.
* python/spot/__init__.py, python/spot/impl.i: Add bindings for it.
* doc/spot.bib (casares.21.icalp): New entry.
* NEWS: Mention this.
2021-07-30 11:00:25 +02:00
Florian Renkin
9669806cd0 Adding signature based minimization of mealy machines
* spot/twaalgos/mealy_machine.cc: Here
* tests/python/mealy.py: Adding tests
2021-07-29 09:50:26 +02:00
philipp
f4776efb63 Adding sat-based minimization for mealy machines
* spot/twaalgos/mealy_machine.hh,
spot/twaalgos/mealy_machine.cc: Here
* spot/twaalgos/Makefile.am: Here
* tests/python/mealy.py: Added tests
* tests/Makefile.am: Adding mealy.py
* python/spot/impl.i: Here
2021-07-29 09:49:45 +02:00
Alexandre Duret-Lutz
d019ea61fe python: make sere twa::acc() survives its automaton
Fixes #468.

* python/spot/__init__.py: Add wrapper around twa::acc() and
twa::get_acceptance() to store the automaton into the acceptance
proxy, therefore ensuring that the automaton survives that proxy.
* tests/python/setacc.py: Test it.
2021-07-12 15:27:07 +02:00
Alexandre Duret-Lutz
31a681c285 twa: implement a copy_named_properties_of() method
It was noted in #470 that make_twa_graph did not copy named
properties.  Let's fix that.

* spot/twa/twa.hh, spot/twa/twa.cc (copy_named_properties_of): New
method.
* spot/twa/twagraph.hh (make_twa_graph): Add an extra argument to
call copy_named_properties_of() optionally.
* python/spot/__init__.py (twa_graph.__copy__): Use it.
* tests/python/twagraph.py: Test that.
* tests/sanity/namedprop.test: Ensure copy_named_properties_of copies
all known named properties.
2021-07-08 10:33:15 +02:00
Alexandre Duret-Lutz
0cf2d285b6 python: implement twa_graph.__copy__
Fixes #470, suggested by Cambridge Yang.

* python/spot/__init__.py (twa_graph.__copy__): Call make_twa_graph.
* tests/python/twagraph.py: Test it.
* NEWS: Mention it.
2021-07-08 09:33:57 +02:00
Alexandre Duret-Lutz
0509263f82 twa: fix intersecting_run on weak automata
Fixes #471, reported by Cambridge Yang.

* spot/twa/twa.cc (intersecting_run): Disable the product
optimization for weak automata.
* tests/python/471.py: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention the bug.
2021-07-08 09:00:29 +02:00
Alexandre Duret-Lutz
09e4ab74a1 twa_run: reduce now diagnoses rejecting runs
Part of #471.

* spot/twaalgos/emptiness.cc: Throw an exception if
the cycle is rejecting.
* spot/twaalgos/emptiness.hh: Document this behavior.
* tests/python/except.py: Test it.
2021-07-07 17:25:29 +02:00
Alexandre Duret-Lutz
b01bc62f52 bitset: fix implementation of operator-()
This fixes #469.

* spot/misc/bitset.hh (bitset::operator-): Rewrite.
I cannot follow the logic of the old implementation.
* tests/python/setacc.py: Add a test case, inspired from #469.
2021-07-05 14:50:19 +02:00
Alexandre Duret-Lutz
3d79022abb adjust some python tests to work with PyPy
Part of #467.

* tests/python/bdddict.py, tests/python/ltl2tgba.py,
tests/python/ltlparse.py, tests/python/ltlsimple.py,
tests/python/sccinfo.py, tests/python/simstate.py,
tests/python/split.py, tests/python/tra2tba.py: Adjust to
deal with a non-refcounted Python implementation.
2021-06-29 23:16:40 +02:00
Alexandre Duret-Lutz
edfcd5b0d8 merge_states: fix segfault reported by Philipp
* spot/twa/twagraph.cc: Here.
* tests/python/mergedge.py: Add test case.
2021-05-31 20:46:41 +02:00
Alexandre Duret-Lutz
634dd28379 merge_states: include sorting and detection of identical self-loops
* spot/twa/twagraph.cc: Implement it.
* spot/twa/twagraph.hh, NEWS: Document it.
* tests/python/mergedge.py: Test it.
* tests/core/ltlsynt.test, tests/python/games.ipynb: Adjust expectations.
2021-05-18 10:50:12 +02:00
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
093de290c1 python: add binding for spot::twa::prop_set
Fix #453.

* python/spot/impl.i: Here.
* NEWS: Mention them.
* tests/python/twagraph.py: Test them.
2021-04-17 10:38:58 +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
93d8f43285 translate: speed up some -G -D cases
When gf-guarentee works and produce a deterministic automaton, use it
right away without comparing it with the automaton produced by the
regular translation.  This used to be the case for all -D scenarios
except -G -D.

Reported by Florian Renkin.

* spot/twaalgos/translate.cc: Use the result of
gf_guarantee_to_ba_maybe() or fg_safety_to_dca_maybe() whenever -D is
used.
* spot/twaalgos/postproc.cc: Call remove_unused_ap() in finalize(), to
iron out some slight output differences.
* tests/core/ltl2tgba2.test, tests/python/toparity.py: Lower expected
results in the test cases.
* tests/python/automata.ipynb, tests/core/prodor.test: Adjust to new
order.
2021-01-27 13:26:49 +01: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
44c074bbad python: fix incorrect assertions on temporary objects
* tests/python/stutter.py: Do not call acc() on a temporary
object, and fix the last two asserts.
2021-01-17 20:48:56 +01:00
Alexandre Duret-Lutz
a8ee291abe * tests/python/ipnbdoctest.py: Work around failures on Fedora. 2021-01-16 16:33:30 +01:00
Alexandre Duret-Lutz
7e2f091839 determinize: do not copy the "incomplete" property
Mentioned in issue #298.

* spot/twaalgos/determinize.cc: Do not copy prop_complete of
the input if it is false.
* tests/python/298.py: Test it.
* NEWS: Mention the bug.
2020-12-15 10:47:25 +01:00
Alexandre Duret-Lutz
f6be083050 determinize: don't emit colors for temporary braces
Related to issue #298.

* spot/twaalgos/determinize.cc: Recognize braces that are temporary
to avoid emitting colors when they become empty.
* tests/python/298.py: New file, showing a reduction of colors.
* tests/Makefile.am: Add it.
* tests/core/ltlsynt.test: Adjust expected output (now smaller).
* tests/core/genltl.test: Adjust one expected output (now larger).
* NEWS: Mention the issue.
2020-12-15 07:58:42 +01:00
Alexandre Duret-Lutz
9a17f5676c game: rewrite, document, and rename solve_reachability_game
* spot/twaalgos/game.hh, spot/twaalgos/game.cc: Rename
solve_reachability_game() as solve_safety_game(), rewrite it (the old
implementation incorrectly marked dead states as winning for their
owner).
* tests/python/paritygame.ipynb: Rename as...
* tests/python/games.ipynb: ... this, and illustrate
solve_safety_game().
* tests/Makefile.am, NEWS, doc/org/tut.org: Adjust.
* tests/python/except.py: Add more tests.
2020-12-10 15:04:07 +01:00
Alexandre Duret-Lutz
fb224d3f63 twagraph: fix merge_edges() ignoring the first edge
This fixes #441, reported by Jérôme Dubois.

* tests/python/mergedge.py: New file.
* tests/Makefile.am: Add it.
* spot/twa/twagraph.cc (merge_edges): Fix initialization of second
loop.
* NEWS: Mention the bug.
2020-11-24 16:08:21 +01:00
Alexandre Duret-Lutz
9cc1bdf10f postprocess, translate: add support for Büchi (not state-based)
spot/twaalgos/postproc.hh: Introduce options Buchi and
GeneralizedBuchi.  The latter is similar to TGBA but the former differs
from BA in that it does not imply state-based acceptance, since that
can be specified separately.  Also all other acceptance types are not
abbreviated, so those new names make more sense.
* NEWS: Mention that.
* spot/twaalgos/postproc.cc, spot/twaalgos/translate.cc: Adjust
to support Buchi and GeneralizedBuchi without breaking BA and TGBA.
* bin/autfilt.cc, bin/common_aoutput.cc, bin/common_post.cc,
bin/ltl2tgta.cc, doc/org/tut10.org, doc/org/tut12.org,
doc/org/tut30.org, python/spot/__init__.py,
tests/python/automata.ipynb, tests/python/langmap.py,
tests/python/misc-ec.py, tests/python/satmin.ipynb,
tests/python/satmin.py, tests/python/toweak.py: Use the new names.
* tests/Makefile.am: Add missing langmap.py.
2020-10-06 17:46:34 +02:00
philipp
29055c8109 Improving split and reorganizing
* spot/twaalgos/synthesis.cc, spot/twaalgos/synthesis.hh: New files
regrouping the functionnalities split and apply_strategy for synthesis
* python/spot/impl.i, spot/twaalgos/Makefile.am: Add them.
* spot/twaalgos/split.cc, spot/twaalgos/split.hh: No longer contains
the splits necessary for for synthesis, moved to
spot/twaalgos/synthesis.cc, spot/twaalgos/split.hh Split is now faster
and reduces the number of intermediate states, reducing the overall
size of the arena
* spot/misc/game.cc, spot/misc/game.hh: Renaming propagate_players to
alternate_players.
* tests/core/ltlsynt.test, tests/python/split.py: Update tests.
* bin/ltlsynt.cc: Adjust to new split. Swap order of split and
to_parity for lar.
2020-09-24 16:29:31 +02:00
Alexandre Duret-Lutz
392c1a0ec3 game: fix handling of useless SCCs
This is a bug I introduced while merging Philipp's patch.

* spot/misc/game.cc (parity_game::solve): Set the strategy for player
0 in useless SCCs.
(parity_game::fix_scc): Do not use sub_game_ to detect edges exiting
the SCC.
* tests/python/game.py: New file.
* tests/Makefile.am: Add it.
2020-09-24 12:18:14 +02:00
philipp
133896d584 game: reimplement parity game solving
* spot/misc/game.cc, spot/misc/game.hh: More efficient implementation
of Zielonka's algorithm to solve parity games.  Now supports SCC
decomposition and efficient handling of certain special cases.
* doc/org/concepts.org: Document "strategy" and "state-winner"
properties.
* bin/ltlsynt.cc, tests/python/paritygame.ipynb: Adjust.
* tests/core/ltlsynt.test: Add more tests.
2020-09-22 23:15:30 +02:00
Alexandre Duret-Lutz
9d7e6386e4 python: reduce automata width to prevent overflows with Jupyter
* python/spot/__init__.py (setup): Reduce the default maximal width of
automata so that Jupyter output does not add an horizontal scroll bar
for a few pixels.
* tests/python/automata-io.ipynb: Adjust.
2020-09-17 11:21:06 +02:00
Alexandre Duret-Lutz
69c821154c postproc: add simul-max and wdba-det-max options
* NEWS, bin/spot-x.cc: Document them.
* spot/twaalgos/postproc.cc, spot/twaalgos/postproc.hh: Implement
them.
* tests/python/stutter-inv.ipynb: Adjust result.
* tests/core/minusx.test: Add test case.
2020-09-16 20:40:16 +02:00
Jerome Dubois
229be9a5db python: add check for panda
* tests/python/ipnbdoctest.py: Skip test if panda is not installed.
2020-09-16 10:22:39 +02:00
Jerome Dubois
ae7d4504cd game: Add set_state_player() and get_state_player()
Fixes #424.

* python/spot/impl.i: Add implicit convertion for vector<bool>.
* spot/misc/game.cc, spot/misc/game.hh: Add set_state_player()
  and get_state_player().
* tests/python/parity.py: Test them.
2020-09-16 10:22:09 +02:00
Alexandre Duret-Lutz
760bde093b python: add some parity-game bindings
* python/spot/impl.i: Process game.hh.
* spot/misc/game.cc, spot/misc/game.hh: Make the output of
parity_game_solve() a solved_game object for easier manipulation in
Python.
* bin/ltlsynt.cc: Adjust usage.
* tests/python/paritygame.ipynb: New file.
* tests/Makefile.am, doc/org/tut.org: Add it.
* NEWS: Mention these bindings.
2020-09-09 15:32:44 +02:00
Alexandre Duret-Lutz
a375089e52 simplify_acceptance: generalize the complementary mark rewriting
Fixes #403.

* spot/twaalgos/cleanacc.cc (simplify_complementary_marks_here):
Assume that two colors are complementary in a broad sense, i.e., on is
present if (but not only if) the other is missing before applying
those rewritings.  Technically, this is usually not necessary, because
the changes done in #418 will cause such "covering-the-full-automaton"
pair of colors to be disjoint so complementary in a strict sense.  It
might make a difference (this is not tested) in presence of reused
colors which #418 cannot remove.  In any case, it's simply less code
to implement the broad sense.
* tests/python/toparity.py: Add test case from #403, which is
reduced to two states with recent optimizations.
2020-07-29 15:01:55 +02:00
Alexandre Duret-Lutz
0c4b701630 improve acceptance simplifications using useless colors
This fixes issue #418.

* spot/twa/acc.cc,
spot/twa/acc.hh (acc_cond::acc_code::useless_colors_patterns): New
method to detect patterns of colors allowing other colors to be added
or removed at will.
* spot/twaalgos/cleanacc.cc (simplify_acceptance_here): Use the above
patterns to remove some useless colors from transitions and hope that
this can help simplify the acceptance condition.
* spot/twaalgos/degen.cc (propagate_marks_vector): Use the pattern to
add more colors.
* tests/core/ltl2tgba2.test: Add the test case from issue #418.
* tests/core/ltl2dstar4.test, tests/core/satmin3.test,
tests/core/sccdot.test, tests/core/sim3.test,
tests/python/automata.ipynb, tests/python/decompose.ipynb,
tests/python/merge.py, tests/python/pdegen.py, tests/python/remfin.py,
tests/python/toparity.py, tests/python/tra2tba.py: Adjust all test
cases.
* NEWS: Mention this new feature.
2020-07-28 22:26:28 +02:00
Alexandre Duret-Lutz
3220da6605 tra_to_tba: finish 05e6e0885
* spot/twaalgos/remfin.cc: Actually use propmarks.
* tests/core/det.test, tests/core/remfin.test,
tests/python/automata.ipynb, tests/python/remfin.py,
tests/python/tra2tba.py: Adjust test cases.
2020-07-27 14:43:27 +02:00
Alexandre Duret-Lutz
ff3a3f8144 * tests/python/ipnbdoctest.py: Ignore matplotlib font cache messages. 2020-07-27 14:43:27 +02:00
Florian Renkin
5ec9d55fea simplify_acceptance: Use color inclusions to simplify a condition
This fixes #406.

* spot/twaalgos/cleanacc.cc: Add the simplification.
* tests/core/remfin.test, tests/python/automata.ipynb,
tests/python/remfin.py: Update tests.
* tests/python/simplacc.py: Update and add tests.
2020-07-25 19:15:17 +02:00