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.
This commit is contained in:
Alexandre Duret-Lutz 2021-10-06 22:51:10 +02:00
parent 0ac5bbc05d
commit bdd20bd1a1
9 changed files with 217 additions and 225 deletions

View file

@ -95,83 +95,6 @@ namespace spot
SPOT_API
bool solve_safety_game(twa_graph_ptr game);
/// \ingroup games
/// \brief Benchmarking and options structure for games and synthesis
///
/// \note This structure is designed to interface with the algorithms
/// found in spot/twaalgos/synthesis.hh and spot/twaalgos/game.hh
struct SPOT_API game_info
{
enum class solver
{
DET_SPLIT=0,
SPLIT_DET,
DPA_SPLIT,
LAR,
LAR_OLD,
};
struct bench_var
{
double total_time = 0.0;
double trans_time = 0.0;
double split_time = 0.0;
double paritize_time = 0.0;
double solve_time = 0.0;
double strat2aut_time = 0.0;
double aig_time = 0.0;
unsigned nb_states_arena = 0;
unsigned nb_states_arena_env = 0;
unsigned nb_strat_states = 0;
unsigned nb_strat_edges = 0;
unsigned nb_latches = 0;
unsigned nb_gates = 0;
bool realizable = false;
};
game_info()
: force_sbacc{false},
s{solver::LAR},
minimize_lvl{2},
bv{},
verbose_stream{nullptr},
dict(make_bdd_dict())
{
}
bool force_sbacc;
solver s;
int minimize_lvl;
std::optional<bench_var> bv;
std::ostream* verbose_stream;
option_map opt;
bdd_dict_ptr dict;
};
/// \ingroup games
/// \brief Stream solvers
SPOT_API std::ostream&
operator<<(std::ostream& os, game_info::solver s);
/// \ingroup games
/// \brief Stream benchmarks and options
SPOT_API std::ostream &
operator<<(std::ostream &os, const game_info &gi);
/// \ingroup games
/// \brief Generic interface for game solving
///
/// Calls the most suitable solver, depending on the type of game/
/// acceptance condition
///
/// \param arena The game arena
/// \param gi struct for options and benchmarking
/// \return Whether the initial state is won by player or not
/// \pre Relies on the named properties "state-player"
/// \post The named properties "strategy" and "state-winner" are set
SPOT_API bool
solve_game(twa_graph_ptr arena, game_info& gi);
/// \ingroup games
/// \brief Generic interface for game solving
///