Commit graph

6059 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
9b3956f892 zlktree: fix handling of automata with false acceptance
Reported by Florian.

* spot/twaalgos/zlktree.cc (zielonka_tree_transform, acd_transform):
Here.
* tests/python/zlktree.py: Add test cases.
2021-10-07 11:11:49 +02:00
Alexandre Duret-Lutz
0ec1ee6de3 move parts of games.ipynb into synthesis.ipynb
* tests/python/synthesis.ipynb: New file, with bits removed from...
* tests/python/games.ipynb: ... here.
* tests/Makefile.am: Add synthesis.ipynb.
* NEWS, doc/org/tut.org: Mention the new notebook.
2021-10-07 10:48:02 +02:00
Alexandre Duret-Lutz
7bc2c31043 game: teach solve_game to use solve_safety_game
* spot/twaalgos/game.cc, spot/twaalgos/game.hh: Here.
* doc/org/tut40.org: Adjust example.
2021-10-07 09:25:01 +02:00
Alexandre Duret-Lutz
bdd20bd1a1 rename game_info to synthesis_info; move it with the synthesis code
* spot/twaalgos/game.cc, spot/twaalgos/game.hh (game_info): Move...
* spot/twaalgos/synthesis.cc,
spot/twaalgos/synthesis.hh (synthesis_info): ... here, because this
structure contains only synthesis stuff.  Also rename "solver" to
"algo" to match the ltlsynt option.
(solve_game): Move the two argument version of this function here,
since that's the only game-related generic function that use
synthesis_info.
* bin/ltlsynt.cc, tests/core/ltlsynt.test, tests/python/games.ipynb,
tests/python/synthesis.py, NEWS: Adjust all uses and mentions.
2021-10-07 09:06:15 +02:00
Alexandre Duret-Lutz
0ac5bbc05d ltlsynt: replace -x minimization-lvl=N by --simplify
* bin/ltlsynt.cc: Implement the new option, and make it default
to bisimulation with output assignment (a.k.a. bwoa).
* NEWS, bin/spot-x.cc, doc/org/ltlsynt.org: Update the documentation.
* spot/twaalgos/game.hh: Make bwoa the default.
* tests/core/ltlsynt.test: Add and adjust test cases.
* tests/python/games.ipynb: Adjust.
2021-10-06 18:00:24 +02:00
Alexandre Duret-Lutz
af5474d791 ltlsynt: replace -x specification-decomposition by --decompose
* bin/ltlsynt.cc: Implement the option, and enable it by default.
* doc/org/ltlsynt.org, doc/org/ltlsynt.tex, bin/spot-x.cc, NEWS:
Document it.
* tests/core/ltlsynt.test: Adjust test cases.
2021-10-06 10:51:42 +02:00
Alexandre Duret-Lutz
5d722ca584 * doc/org/tut.org: Fix a title. 2021-10-06 10:46:22 +02:00
Alexandre Duret-Lutz
405f76f0a0 games, synthetis: improve Doxygen
* spot/twaalgos/game.hh, spot/twaalgos/synthesis.hh,
spot/twaalgos/aiger.hh: Declare new Doxygen groups for games and
synthesis.
* doc/spot.bib: Cleanup.
2021-10-03 19:27:08 +02:00
Alexandre Duret-Lutz
188fee4756 * tests/core/ltlsynt.test: Test --aiger without option. 2021-10-03 18:37:55 +02:00
Alexandre Duret-Lutz
17070b6cee aiger: fix some typos and inconsistencies
* spot/twaalgos/aiger.hh: Fix errors in documentation.
* spot/twaalgos/aiger.cc: Adjust text of exception.
2021-10-03 18:33:57 +02:00
Alexandre Duret-Lutz
590929fbcf ltlsynt: improve documentation
This addresses a few points from #479.

* doc/org/ltlsynt.tex: New file.
* doc/Makefile.am: Add it.
* doc/org/ltlsynt.org: Show the architecture, and mention more
options.
* bin/spot-x.cc: Document ltlsynt's -x options.
* bin/ltlsynt.cc: Fix default value of --aiger, and typo in its
documentation.
2021-10-03 15:24:23 +02:00
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
60225fd139 acd: do not recompute identical subtrees
* spot/twaalgos/zlktree.cc, spot/twaalgos/zlktree.hh (acd::build_):
When processing a node identical to a node previously seen, simply
copy the children of that other node, and share its vectors.
2021-10-01 08:48:11 +02:00
Alexandre Duret-Lutz
2c435c6c11 zlktree: simplify heuristic computation
* spot/twaalgos/zlktree.cc: Here.
* spot/twaalgos/zlktree.hh: Add a way to remove an option.
2021-10-01 08:48:11 +02:00
Alexandre Duret-Lutz
88d0d2e112 org: cleanup tut40
* doc/org/tut40.org: Add more explanations and some cleanup.
* python/spot/__init__.py (set_state_players, get_state_winners,
get_state_players, set_state_player, get_state_winner,
get_state_player, get_strategy): Add these methods to the twa_graph
class for convenience.
* NEWS, doc/org/tut.org: Mention tut40.org.
2021-10-01 08:48:11 +02:00
Jerome Dubois
211e7d90d3 org: Add a pratical example for games
* doc/org/tut40.org: Add a documentation on how to use games in a
pratical case. In this example, we compute simulation using
games. Fixes #445.
* doc/Makefile.am: Add tut40.org.
2021-10-01 08:47:28 +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
ddda68403f * spot/twa/twagraph.cc: Fixes #478. 2021-09-21 11:20:14 +02:00
Philipp
3f606cdc35 Updated News
* NEWS: Here
2021-09-21 11:03:44 +02:00
Florian Renkin
8296079282 synthesis: aps_of uses a local cache
* spot/twaalgos/synthesis.cc: here.
2021-09-17 17:15:32 +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
Alexandre Duret-Lutz
4710577dfe build: fix multiple GCC warnings
These occur when Spot is compiled with --enable-optimizations and
--disable-assert.

* spot/mc/unionfind.cc, spot/twaalgos/mealy_machine.cc,
spot/twaalgos/aiger.cc: Work around warnings about variables that are
only used in assert.
* spot/misc/common.hh [NDEBUG] (SPOT_ASSUME): Do not define
as assert() when it is disabled.
* spot/twaalgos/alternation.cc: Use insert instead of emplace
to work around a spurious possible nullptr dereference.
* spot/twaalgos/ltl2taa.cc, spot/twaalgos/ndfs_result.hxx,
spot/twaalgos/tau03.cc, spot/twaalgos/tau03opt.cc:
Work around spurious possible nullptr dereference.
* spot/twaalgos/sbacc.cc: Work around spurious "maybe uninitialized"
warning.
2021-09-17 17:09:42 +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
7c1230b484 synthesis: fix decomposition
It is wrong to decompose an implication that is not at the top of
the formula.

* spot/twaalgos/synthesis.cc: don't always split implication
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
Florian Renkin
306a45f239 Aiger: Add a way to evaluate an input sequence (Python)
Add a method to the class aig (Python) that produces a sequence of
outputs for a given sequence of inputs.

* python/spot/__init__.py: here
2021-09-16 14:53:49 +02:00
Florian Renkin
b9ec16f9c2 Typos
* bin/ltlsynt.cc, spot/twaalgos/game.hh,
spot/twaalgos/synthesis.cc: here
2021-09-16 14:53:48 +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
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