Commit graph

976 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
ee83e8e4c2 tests: work around to compiler warnings
* tests/core/cube.cc, tests/core/twagraph.cc: Fix warning about
unused variable in absence of assert().
2021-10-03 00:57:21 +02:00
Alexandre Duret-Lutz
644342f5d4 simplify: fix some discrepancies between Intel and ARM
* spot/tl/simplify.cc (tl_simplifier_cache::as_bdd): Fix the order in
which as_bdd() is called recursively in binary nodes, do not let the
choice to the compiler.
* tests/core/ltlsynt.test: Adjust expected output.
2021-10-03 00:57:15 +02:00
Alexandre Duret-Lutz
1b69ed96f9 ltlsynt: deduce --outs from --ins or vice-versa
* bin/ltlsynt.cc: Implement it.
* NEWS, doc/org/ltlsynt.org: Document it.
* tests/core/ltlsynt.test: Test it.
2021-10-02 21:57:58 +02:00
Alexandre Duret-Lutz
ee80849caf dtwasat: various fixes
* spot/twaalgos/dtwasat.cc: Do not return a transition-based automaton
when state-based output is requested.
* tests/python/satmin.ipynb, spot/twaalgos/dtbasat.hh: Fix some typos.
* tests/python/satmin.py: Add test cases.
* NEWS: Mention the bugs.
2021-09-29 16:50:49 +02:00
Alexandre Duret-Lutz
fea0be96c1 acd: add ORDER_HEURISTIC for state-based ACD-transform
* spot/twaalgos/zlktree.cc, spot/twaalgos/zlktree.hh: Add the
acd_options::ORDER_HEURISTIC and use it by default in
acd_transform_sbacc().
* spot/misc/bitvect.hh (bitvect::count, bitvect::add_common): New
methods.
* tests/python/zlktree.ipynb: Adjust examples and discuss this
heuristic.
2021-09-24 22:28:10 +02:00
Alexandre Duret-Lutz
70ede35702 acd: add support for state-based output
* spot/twaalgos/zlktree.hh, spot/twaalgos/zlktree.cc (acd::node_level,
acd::state_step, acd_transform_sbacc): New public functions.
* tests/python/zlktree.ipynb, tests/python/zlktree.py: More tests.
* NEWS: Typo.
2021-09-24 13:38:51 +02:00
Alexandre Duret-Lutz
043a1dc394 acd: fix typeness checks, and add options for those
* spot/twaalgos/zlktree.cc, spot/twaalgos/zlktree.hh: Here.
* tests/python/zlktree.ipynb, tests/python/zlktree.py: Add tests
and examples.
2021-09-24 11:11:53 +02:00
Philipp Schlehuber
406bc8ed17 Remove do_simplify opt from split_2step
Removing this option to guarante that all arenas
are alternating

* spot/twaalgos/synthesis.hh: Here
* spot/twaalgos/synthesis.cc: Here
* spot/twaalgos/mealy_machine.cc: API change
* tests/python/aiger.py: API change
* tests/python/mealy.py: API change
* tests/python/split.py: API change
2021-09-22 12:52:10 +02:00
Alexandre Duret-Lutz
cb3a833a8d ltlsynt: fix syntax error handling
Fixes #477.

* bin/common_finput.cc (job_processor::process_string): Fix return
value.
* bin/ltlsynt.cc: Fix handling of syntax errors.  While we are here,
make sure game_info is destroyed before Spot's globals.
* tests/core/ltlsynt.test: Add a test case.
2021-09-17 17:09:49 +02:00
Philipp Schlehuber
c973fcdf2d Improving handling of unused proposition for aig
By default only propositions appearing in the strategy are
treated. By handing over propositions explicitly one
can force their appearance in the aig circuit.

* spot/twaalgos/aiger.cc: Here
* spot/twaalgos/aiger.hh: New doc
* tests/python/games.ipynb: New test
2021-09-16 14:53:49 +02:00
Florian Renkin
ad5203e77a synthesis: Fix segfault when there is no output
* spot/twaalgos/synthesis.cc: here
* tests/python/synthesis.py: create a test
* tests/Makefile.am: add synthesis.py to the tests
2021-09-16 14:53:49 +02:00
philipp
7d908b9320 ltlsynt rewrite
Introducing the new game interface
to ltlsynt.
ltlsynt now also uses direct strategy deduction
and formula decomposition.

* bin/ltlsynt.cc: Here
* spot/twaalgos/aiger.cc
, spot/twaalgos/aiger.hh: Use strategy_like
* spot/twaalgos/game.hh: Minor adaption
* spot/twaalgos/mealy_machine.cc: Use new interface
* spot/twaalgos/synthesis.cc
, spot/twaalgos/synthesis.hh: Spezialised split
* tests/core/ltlsynt.test
, tests/python/games.ipynb: Adapting
2021-09-16 14:53:48 +02:00
philipp
a5185c2123 Use new minterm enumeration in split_2step
Also remove self-loop for sink and make it work for any
acceptance condition.

* spot/twaalgos/synthesis.cc: Here
* tests/core/ltlsynt.test: Adjust tests
* tests/python/split.py: Adjust tests
2021-09-16 14:53:48 +02:00
philipp
4260b17fba New game api
Introduce a new, uniform way to create and solve
games.
Games can now be created directly from specification
using creat_game, uniformly solved using
solve_game and transformed into a strategy
using create_strategy.
Strategy are mealy machines, which can be minimized.

* bin/ltlsynt.cc: Minor adaption
* spot/twaalgos/game.cc: solve_game, setters and getters
for named properties
* spot/twaalgos/game.hh: Here too
* spot/twaalgos/mealy_machine.cc: Minor adaption
* spot/twaalgos/synthesis.cc: create_game, create_strategy and
minimize_strategy
* spot/twaalgos/synthesis.hh: Here too
* tests/core/ltlsynt.test: Adapting
* tests/python/aiger.py
, tests/python/games.ipynb
, tests/python/mealy.py
, tests/python/parity.py
, tests/python/split.py: Adapting
2021-09-16 14:53:47 +02:00
philipp
786599ed20 Adding selective edge sorting and state merging
The merging is (possibly) more expensive but also
merges more states when applied to all states.

* spot/graph/graph.hh: edge sorting
* spot/twa/twagraph.cc,
spot/twa/twagraph.hh: selective state merging
* tests/core/twagraph.cc: Adjusting tests
2021-09-16 14:53:47 +02:00
philipp
2c267dd894 Adding dot suppport for aiger class
* spot/twaalgos/aiger.cc: Useless assert
* spot/twaalgos/dot.hh,
spot/twaalgos/dot.cc: aig to dot
* python/spot/__init__.py: Adapting
* tests/python/games.ipynb: Additional tests
2021-09-16 14:53:47 +02:00
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
4c94e14f86 parseaut: replace std::map by robin_hood::unordered_flat_map
This improves the parsing performance a bit more.

* spot/parseaut/parsedecl.hh, spot/parseaut/parseaut.yy: Here.
* tests/sanity/style.test: Handle parsedecl.hh as a private header.
2021-09-15 16:53:00 +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
b6df1f8f92 bitvect: add a foreach_set_index(callback) function
Related to #476, where that is needed.

* spot/misc/bitvect.hh: Here.
* tests/core/bitvect.cc, tests/core/bitvect.test: Add some tests.
2021-09-11 01:00:24 +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
d5b641a7dc build: use 'jupyter nbconvert' instead of 'ipython nbconvert'
The latter is deprecatd.

* configure.ac: Check for jupyter.
* tests/Makefile.am: Adjust.
* HACKING: Mention we need jupyter.
2021-09-04 22:08:20 +02:00
Alexandre Duret-Lutz
4d2ced1b07 * tests/Makefile.am: Fix location of zlktree.ipynb. 2021-09-04 20:54:50 +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
4855d3c877 dot: add an option to output id= attributes
This will be handy latter to develop widgets with interactive
highlighting of automata.

* spot/twaalgos/dot.cc: Implement it.
* bin/common_aoutput.cc, NEWS, doc/org/oaut.org,
doc/org/spot.css: Document it.
* tests/core/alternating.test, tests/core/readsave.test,
tests/core/sccdot.test: Test it.
2021-09-03 22:38:24 +02:00
Alexandre Duret-Lutz
d4e3b0bed4 tests: fix a gcc-snapshot warning
* tests/core/ikwiad.cc: replace dynamic_pointer_cast by a
static_pointer_cast to get rid of a possible nullptr warning.
2021-09-01 14:02:46 +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
200ee0d204 style: better support if statement with initializer
* tests/sanity/style.test: Here.
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
4570c735f3 merge_states: don't call defrag_states if unnecessary
* spot/twa/twagraph.cc (merge_states): Return the number
of removed states, and use that to decide if defrag_states
is needed.
* spot/twa/twagraph.hh, NEWS: Document that.
* tests/core/tgbagraph.test, tests/core/twagraph.cc: Adjust test case.
2021-07-26 11:43:17 +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
47348a9755 improve PyPy support by following PEP 3149
This implement the suggestion is issue #467 but the test suite is
still not completely passing with pypy3.

* m4/pypath.m4: Detect the suffix for extensions.
* python/Makefile.am: Use it.
* tests/run.in: Recognize pypy3 as a Python version.
2021-06-29 21:15:04 +02:00
Alexandre Duret-Lutz
ba0c8e8a29 use <cassert> and not <assert.h> in C++
* spot/mc/unionfind.cc, spot/twacube/cube.cc,
spot/twacube_algos/convert.cc: Includes code.
* tests/sanity/style.test: Add a test for this.
2021-06-15 12:34:15 +02:00
Alexandre Duret-Lutz
99241d0bea typos: coma -> comma
* ChangeLog.1, tests/core/autcross3.test, tests/core/ltl3ba.test,
tests/core/ltl3dra.test, tests/core/ltlcross3.test,
tests/core/ltlsynt.test, tests/sanity/style.test: Here.
2021-06-11 11:47:34 +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