Commit graph

6176 commits

Author SHA1 Message Date
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
Florian Renkin
98ab826255 Introducing formula split
Split a LTL formula to a set of formula that don't share
output proposition. It allows to create multiple
strategies in ltlsynt.

* spot/twaalgos/synthesis.cc,
  spot/twaalgos/synthesis.hh: here
* doc/spot.bib: Add reference
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
philipp
18948a96be Adding bdd_is_cube for python
* python/buddy.i: Here
2021-09-16 14:53:45 +02:00
philipp
3aef5f31c0 [buddy] Adding bdd_is_cube
bdd_is_cube determines whether or not a given bdd
represents a cube.

* src/bddop.c: Here
* src/bddx.h: And here
2021-09-16 14:53:45 +02:00
Alexandre Duret-Lutz
5a0fbf6cb9 [buddy] introduce a bdd_satoneshortest() function
* src/bddop.c, src/bddx.h: Introduce this function.
* src/bddtest.cxx: Add some short tests.
2021-09-16 14:53:45 +02:00
Alexandre Duret-Lutz
830f68b3b9 robin_hood: Update to version 3.11.3
The only difference with upstream is that we keep std::malloc() as
malloc() to avoid issues with gnulib that sometimes redefine malloc to
rpl_malloc with a macro without defining std::rpl_malloc.

* spot/priv/robin_hood.hh, debian/copyright: Update.
* spot/priv/Makefile.am (update): Rename std::malloc to malloc.
2021-09-16 14:07:17 +02:00
Alexandre Duret-Lutz
42ff02585b parseaut: convert short numbers without strtoul()
* spot/parseaut/scanaut.ll: One or two digits numbers can be safely
converted to integer without risking overflow, so do that without
calling strtoul().  This simple change halves the number of calls
to strtoul() on the example automaton of issue #476.
2021-09-15 17:21:04 +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
ce1cf5507f parseaut: improve parsing of HOA labels
On a debug build with the automaton from #476, the gain seems to be
about 33% of the parsing time.

* spot/parseaut/parseaut.yy, spot/parseaut/parsedecl.hh,
spot/parseaut/scanaut.ll: Share a hash map of string->BDD
between the scanner and parser so that [labels] can be looked
up by the scanner if they have already been parsed once.
* NEWS: Mention it.
2021-09-13 17:21:49 +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
2d1cb0ddcd zlktree: replace std::vector<bool> by bitvect in ACD
On the example from previous patch, the number of instruction fetches
goes from 18490399159 down to 18248898077.

* spot/twaalgos/zlktree.cc, spot/twaalgos/zlktree.hh (acd): Use
bitvect instead of std::vector<bool> in nodes.  This make is easier to
update an edge of a bitvector shared by multiple nodes set after
pruning non-maximal sets from an SCC.  Also compute the set of states
hit by the edges at the very end, once all nodes are known.
* spot/twaalgos/sccinfo.cc, spot/twaalgos/sccinfo.hh,
spot/twaalgos/genem.cc, spot/twaalgos/genem.hh: Adjust to work with
bitvect as filter.
2021-09-11 01:00:38 +02:00
Alexandre Duret-Lutz
6aa2079079 zlktree: speedup the construction of ACD nodes
This uses the foreach_set_index() method introduced in the previous
patch to speed up the copy bitvectors in ACD nodes, as pointed in
issue #476.

Running
PREFIXCMD='valgrind --tool=callgrind' ./run python3 -c \
"import spot; spot.acd_transform(spot.automaton('syntcomp_91.hoa'))"
went from 65139436227 instruction fetches down to 18490399159.

* spot/twaalgos/zlktree.cc (acd::build_): Use foreach_set_index().
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
850608a5fd zlktree: add a cheap unit-propagation
If the top-level has top unit-Inf, propagate it.  This was suggested
by Jan Strejček yesterday.

* spot/twaalgos/zlktree.cc (max_models): Here.
2021-09-08 17:12:14 +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
dc17762e14 * doc/org/oaut.org (dot2tex): Acknowledge the 2.11 release. 2021-09-03 22:38:24 +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
d5bbeceeb2 * .gitlab-ci.yml (mingw-shared, mingw-static): Build from a tarball. 2021-09-01 17:57:25 +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
49b5d570e7 zlktree: share bitvectors in ACD
Improve the memory usage of the acd class by sharing state-vectors and
edges-vectors.

* spot/twaalgos/zlktree.cc, spot/twaalgos/zlktree.hh: Share the
vectors during the construction, and adjust the dot output to take
this into account.
2021-08-31 13:33:49 +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
c924c63255 Merge branch 'master' into next 2021-08-10 17:43:20 +02:00
Alexandre Duret-Lutz
3c7a2c9b4a Bump version to 2.9.8.dev
* NEWS, configure.ac: Here.
2021-08-10 17:38:54 +02:00
Alexandre Duret-Lutz
db0440f1fe Release Spot 2.9.8
* NEWS, configure.ac, doc/org/setup.org: Bump version to 2.9.8.
2021-08-10 17:37:00 +02:00
Alexandre Duret-Lutz
87022c23c6 * NEWS: Update for 2.9.8. 2021-08-10 13:39:49 +02:00
Alexandre Duret-Lutz
d8a75518e4 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-08-10 13:39:49 +02:00
Alexandre Duret-Lutz
c34192a77c 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-08-10 13:39:49 +02:00
Alexandre Duret-Lutz
eb3474d82b fix a gcc-snapshot -Wnoexcept diagnostic
* spot/misc/hash.hh (ptr_hash): Add noexcept on constructor to please
gcc-snapshot.
2021-08-10 13:39:49 +02:00
Alexandre Duret-Lutz
c0c76904da 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-08-10 13:39:49 +02:00
Alexandre Duret-Lutz
bb7426c0b9 org: we have a conda-forge package
* doc/org/install.org: Add conda instructions.
2021-08-10 13:39:45 +02:00
Alexandre Duret-Lutz
487bbb63de work around a null pointer dereference error
This fixes #462.

* spot/twaalgos/gfguarantee.cc (do_g_f_terminal_inplace): Replace the
redirect_src vector by a unique_ptr<unsigned[]>.  Not only does this
remove the false positive diagnostic, but it also removes the unneeded
default initialization of the elements of that vector.
2021-08-10 13:27:45 +02:00
Alexandre Duret-Lutz
77545824eb ltlfilt: fix a typo in the --help text
* bin/ltlfilt.cc: Here.
2021-08-10 13:26:55 +02:00
Alexandre Duret-Lutz
773939bebe 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-08-10 13:26:12 +02:00
Alexandre Duret-Lutz
2e14eb0c02 [buddy] typo coma -> comma
* ChangeLog.1: Here.
2021-08-10 13:25:28 +02:00