Commit graph

59 commits

Author SHA1 Message Date
philipp
6ebe3d7447 Use generic split after obtaining direct strategy
* bin/ltlsynt.cc: Here
2021-11-11 00:38:14 +01:00
Florian Renkin
7947ffc930 ltlsynt: correct verbose when --aiger is used
* bin/ltlsynt.cc: here
* tests/core/ltlsynt.test: add test
2021-11-04 10:20:48 +01:00
Florian Renkin
8aa9da7fc8 Synthesis: rewrite bypass
* spot/twaalgos/synthesis.cc: here
* spot/twaalgos/synthesis.hh: introduce a realizability_code
* bin/ltlsynt.cc, spot/twaalgos/aiger.cc: use this enum
* tests/core/ltlsynt.test: update tests
2021-11-02 10:22:40 +01:00
Alexandre Duret-Lutz
074678416f ltlsynt: improve error message in case of missing --ins and --outs
* bin/ltlsynt.cc: Here.
* tests/core/ltlsynt.test: Test the error.
2021-10-22 17:46:21 +02:00
Alexandre Duret-Lutz
c43712682f synthesis: rename create_game() to ltl_to_game()
* bin/ltlsynt.cc, spot/twaalgos/aiger.hh, spot/twaalgos/synthesis.cc,
spot/twaalgos/synthesis.hh, tests/python/synthesis.ipynb,
tests/python/synthesis.py: Here.
2021-10-18 09:17:40 +02:00
Alexandre Duret-Lutz
5fd4d94031 ltlsynt: replace some leftover throw by error()
* bin/ltlsynt.cc (solve_formula): Report errors with error().
2021-10-11 13:39:52 +02:00
Alexandre Duret-Lutz
82d4fc8ed9 ltlsynt: report AP missing from --ins and --outs
* bin/ltlsynt.cc (process_formula): Add a check.
* tests/core/ltlsynt.test: Add test case.
2021-10-09 21:18:21 +02:00
Alexandre Duret-Lutz
0e5f2d4819 ltlsynt: --ins is optional but not its argument
Fixes #481, reported by Michaël Cadilhac.

* bin/ltlsynt.cc (argp_option): Remove erroneous OPTION_ARG_OPTIONAL.
* tests/core/ltlsynt.test: Add test case.
2021-10-09 20:50:38 +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
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
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
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
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
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
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
23323b743f postproc: introduce dba-simul, and have simul=0 disable all *-simul
* spot/twaalgos/postproc.cc, spot/twaalgos/postproc.hh: Implement the
dba-simul option, and disable ba-simul, dba-simul, dpa-simul,
det-simul when simul=0.
* bin/ltlsynt.cc: Adjust.
* bin/spot-x.cc: Document dba-simul and adjust other variables.
* tests/core/minusx.test: Add some test.
2021-05-03 13:30:03 +02:00
Alexandre Duret-Lutz
05449a42d3 move game.cc from misc/ to twaalgos/
* spot/misc/game.cc, spot/misc/game.hh: Move...
* spot/twaalgos/game.cc, spot/twaalgos/game.hh: ... here.
* bin/ltlsynt.cc, python/spot/impl.i, spot/misc/Makefile.am,
spot/twaalgos/Makefile.am: Adjust.
2020-12-09 16:47:18 +01: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
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
philipp
0d43bedacb game: reimplement print_aiger
* spot/twaalgos/aiger.cc, spot/twaalgos/aiger.hh: Reimplement
print_aiger for speed gain, also heuristics to minimize the number
of gates as well as different encoding types have been added.
* bin/ltlsynt.cc: Make the new options for print-aiger available.
* tests/core/ltlsynt.test: Adjust tests.
2020-09-19 18:41:52 +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
9e8a842975 game: make a propagate_players() function public
* bin/ltlsynt.cc (complete_env): Replace this function by...
* spot/misc/game.hh, spot/misc/game.cc (propagate_players): ... this
new one, hiding the "state-player" business from ltlsynt.  Also do not
create a sink states unless necessary.
* tests/core/ltlsynt.test: Adjust expected number of states.
2020-09-08 22:30:40 +02:00
Alexandre Duret-Lutz
ea9384dd4b extend HOA I/O to preserve the state-player property
* spot/parseaut/parseaut.yy, spot/parseaut/scanaut.ll,
spot/twaalgos/hoa.cc: Add input and output support.
* doc/org/hoa.org: Document the HOA extension.
* bin/ltlsynt.cc: Add a --print-game-hoa option to
produce such format.
* tests/core/gamehoa.test: New file to test this.
* tests/Makefile.am: Add it.
* NEWS: Mention this new feature.
2020-09-08 20:20:48 +02:00
Alexandre Duret-Lutz
25c75c55b1 game: git rid of the parity_game class
This class was a simple wrapper on top of twa_graph_ptr, but it's
easier to simply use a twa_graph_ptr with a "state-player" property
instead, this way we will be able to modify the automata I/O routines
to support games directly.

* spot/misc/game.cc, spot/misc/game.hh: Rewrite the solver and
pg_printer interface.
* bin/ltlsynt.cc: Adjust.
* NEWS: Mention this change.
* doc/org/concepts.org: Mention the state-player property.
2020-09-08 20:20:48 +02:00
Alexandre Duret-Lutz
f6cf8e4d8a ltlsynt: use wdba-minimize=2 and ba-simul=0
* bin/ltlsynt.cc: Here.
* tests/core/ltlsynt.test: Add extra test case.
* NEWS: Mention ltlsynt -x and related defaults.
2020-05-24 22:16:48 +02:00
Florian Renkin
0413ecfbb8 ltlsynt: Change default options
* bin/ltlsynt.cc: Change default options.
* tests/core/ltlsynt.test: Add test.
2020-05-24 20:16:43 +02:00
Florian Renkin
494471a50b ltlsynt: Add more elements in csv
* bin/ltlsynt.cc: Add the number of states of the dpa
and of the parity game in the csv.
2020-05-24 19:57:30 +02:00
Florian Renkin
3fd5f38248 ltlsynt: Add -x option for translation
* bin/ltlsynt.cc: ltlsynt can use extra options for translator.
2020-05-24 19:57:30 +02:00
Alexandre Duret-Lutz
a395309f4b ltlsynt: add --algo=ps
* bin/ltlsynt.cc: Implement this.
* tests/core/ltlsynt.test: Add a test case.
* NEWS: Mention it.
2020-05-24 09:52:38 +02:00
Alexandre Duret-Lutz
66aa6d0883 ltlsynt: make sure the previous Xor optimization actually works
* spot/tl/simplify.hh, spot/tl/simplify.cc,
spot/twaalgos/translate.cc: Update the tl_simplification
options after all preferences have been given.
* bin/ltlsynt.cc: Display the size of the translation output.
* tests/core/ltlsynt.test: Add test case.
2020-05-16 19:22:28 +02:00
Alexandre Duret-Lutz
82d69241f1 ltlsynt: add a --csv=FILENAME option
* bin/ltlsynt.cc: Add a --csv option to record the
duration of the various phases.
* tests/core/ltlsynt.test: Test the new option.
* NEWS: Mention it.
2020-04-30 08:14:50 +02:00
Alexandre Duret-Lutz
fe340ae8db ltlsynt: fix lar.old implementation
* bin/ltlsynt.cc: Make sure to_parity_old() receive a deterministic
automaton, for correctness.   Also call reduce_parity() afterward,
to match what was done in 2.8.7.
* tests/core/ltlsynt.test: Include lar.old in the comparison of all
results to make sure it give the same result as the other 3
algorithms.
2020-04-25 16:29:03 +02:00
Alexandre Duret-Lutz
a6da6ed95a ltlsynt: add option to call to_parity_old
* bin/ltlsynt.cc: Add support for --algo=lar.old
* NEWS: Mention it.
2020-04-20 14:48:23 +02:00
Florian Renkin
0a4312f8fe Adapt ltlsynt to the new version of to_parity
* bin/ltlsynt.cc: Use colorize_parity_here() but remove
 reduce_parity_here() already used in the new version of
 to_parity().
2020-03-24 19:51:24 +01:00
Florian Renkin
6489d6c091 ltlsynt: Correct segfault with ds algorithm and verbose
* bin/ltlsynt.cc: Use initialized DPA when printing when
 we use DET_SPLIT and verbose.
2020-03-22 16:04:44 +01:00
Alexandre Duret-Lutz
74d1ec2bff * bin/ltlsynt.cc: Typo. 2019-10-07 20:22:24 +02:00
Alexandre Duret-Lutz
d523ce8ba4 bin: handle any exception before returning from parse_opt()
On some architectures (e.g., ARM, or even some -flto setups on Intel)
C++ exceptions to not traverse the C functions.  So even if the C++
main() has a try/catch, it will not catch the exception thrown by C++
code called from the argp module (which is compiled in C).

* bin/common_setup.cc, bin/common_setup.hh: Define some macros
and function to factorize exception handling.
* bin/autcross.cc, bin/autfilt.cc, bin/common_aoutput.cc,
bin/common_color.cc, bin/common_finput.cc, bin/common_hoaread.cc,
bin/common_output.cc, bin/common_post.cc, bin/common_trans.cc,
bin/dstar2tgba.cc, bin/genaut.cc, bin/genltl.cc, bin/ltl2tgba.cc,
bin/ltl2tgta.cc, bin/ltlcross.cc, bin/ltldo.cc, bin/ltlfilt.cc,
bin/ltlgrind.cc, bin/ltlsynt.cc, bin/randaut.cc, bin/randltl.cc:
Protect all parse_opt() functions, even those where there is currently
no exception risk.
2019-09-26 15:19:57 +02:00
Alexandre Duret-Lutz
09c93a3a3d forbid the use of std::endl on std::cerr
std::cerr will flush after each operator<< by default, so it's simpler
to use \n instead of std::endl, especially if we can merge \n into the
previous string.  Ideally we should prefer \n for std::cout as well,
but there are reasonable cases where we want to call std::endl there,
so it's hard to enforce.

* tests/sanity/style.test: Diagnose occurrences of cerr.*<<.*endl.
* bin/autcross.cc, bin/autfilt.cc, bin/ltlcross.cc, bin/ltlsynt.cc,
spot/tl/formula.cc, spot/twa/bdddict.cc, tests/core/checkpsl.cc,
tests/core/checkta.cc, tests/core/consterm.cc, tests/core/emptchk.cc,
tests/core/equalsf.cc, tests/core/ikwiad.cc, tests/core/kind.cc,
tests/core/length.cc, tests/core/ltlrel.cc, tests/core/parity.cc,
tests/core/randtgba.cc, tests/core/reduc.cc, tests/core/syntimpl.cc,
tests/ltsmin/modelcheck.cc: Fix them.
2019-07-17 09:15:50 +02:00
Alexandre Duret-Lutz
c9ddbd0a73 ltlsynt: use reduce_parity()
* bin/ltlsynt.cc: Here.
* tests/core/ltlsynt.test: Adjust.
2019-06-19 23:15:02 +02:00
Alexandre Duret-Lutz
8c13d7209e ltlsynt: misc typos
* doc/org/ltlsynt.org: Fix example.
* bin/ltlsynt.cc: Fix --help text.
2019-06-18 19:12:42 +02:00
Maximilien Colange
8d5d453efa ltlsynt: new algorithm, based on LAR
* bin/ltlsynt.cc: here
* tests/core/ltlsynt.test: test it
* NEWS: document it
2018-07-27 15:34:39 +02:00
Maximilien Colange
bd75ab5b39 ltlsynt: rework synthesis algorithms
ltlsynt now offers two algorithms: one where splitting occurs before
determinization (the historical one) and one where determinization
occurs before splitting.

* bin/ltlsynt.cc: here
* tests/core/ltlsynt.test: test it and refactor test file
* NEWS: document it
* spot/misc/game.hh, spot/misc/game.cc: remove Calude's algorithm
2018-07-27 14:22:11 +02:00
Alexandre Duret-Lutz
645bb55622 bin: factor exception-handling code
* bin/common_setup.cc, bin/common_setup.hh: Define a protected_main()
function that deal with exceptions.
* bin/autcross.cc, bin/autfilt.cc, bin/dstar2tgba.cc, bin/genaut.cc,
bin/genltl.cc, bin/ltl2tgba.cc, bin/ltl2tgta.cc, bin/ltlcross.cc,
bin/ltldo.cc, bin/ltlfilt.cc, bin/ltlgrind.cc, bin/ltlsynt.cc,
bin/randaut.cc, bin/randltl.cc: Use it for all tools.
2018-05-16 20:15:04 +02:00
Maximilien Colange
1fdc32f9bb ltlsynt: improve construction of turn-based games
Improve the way transitions are duplicated when preparing the turn-based
game for synthesis. The resulting arena should now be deterministic on
nodes owned by the environment. Also move the code to another file, so
that it is easier to test (e.g. in Python).

* bin/ltlsynt.cc: move the code
* spot/twaalgos/split.cc, spot/twaalgos/split.hh: move the code and
  implement the improvements
* tests/Makefile.am, tests/python/split.py: test it
* tests/core/ltlsynt.test: update existing tests to reflect the changes
2018-04-30 14:41:52 +02:00
Maximilien Colange
9698363ef5 parity game: various improvements
Zielonka algorithm has been fixed and optimized.
It also now computes the strategy for both players.

* bin/ltlsynt.cc: Update calls to parity_game::solve()
* spot/misc/game.cc, spot/misc/game.hh: Implement the changes
2018-04-23 11:51:12 +02:00
Maximilien Colange
0e29d30d1b ltlsynt: fix the construction of the arena
* bin/ltlsynt.cc: implement it
* tests/core/ltlsynt.test: update tests
2018-04-23 11:51:12 +02:00
Maximilien Colange
5d80cc556c Add a verbose option to ltlsynt
* bin/ltlsynt.cc: implement it
2018-04-23 11:51:02 +02:00