spot 2.12.0.dev
Loading...
Searching...
No Matches
synthesis.hh
1// -*- coding: utf-8 -*-
2// Copyright (C) by the Spot authors, see the AUTHORS file for details.
3//
4// This file is part of Spot, a model checking library.
5//
6// Spot is free software; you can redistribute it and/or modify it
7// under the terms of the GNU General Public License as published by
8// the Free Software Foundation; either version 3 of the License, or
9// (at your option) any later version.
10//
11// Spot is distributed in the hope that it will be useful, but WITHOUT
12// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14// License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19#pragma once
20
21#include <spot/twa/twagraph.hh>
22#include <spot/twaalgos/game.hh>
23#include <spot/twaalgos/relabel.hh>
24#include <bddx.h>
25
26namespace spot
27{
28
31 struct SPOT_API synthesis_info
32 {
33 enum class algo
34 {
35 DET_SPLIT=0,
36 SPLIT_DET,
37 DPA_SPLIT,
38 LAR,
39 LAR_OLD,
40 ACD,
41 };
42
43 enum class splittype
44 {
45 AUTO=0, // Uses a heuristic to choose
46 EXPL, // Explicit enumerations of inputs
47 SEMISYM, // Works on one bdd per env state
48 FULLYSYM // Works on a fully symbolic version of the automaton
49 };
50
51 struct bench_var
52 {
53 double total_time = 0.0;
54 double trans_time = 0.0;
55 double split_time = 0.0;
56 double paritize_time = 0.0;
57 double solve_time = 0.0;
58 double strat2aut_time = 0.0;
59 double simplify_strat_time = 0.0;
60 double aig_time = 0.0;
61 unsigned nb_states_arena = 0;
62 unsigned nb_states_arena_env = 0;
63 unsigned nb_strat_states = 0;
64 unsigned nb_strat_edges = 0;
65 unsigned nb_simpl_strat_states = 0;
66 unsigned nb_simpl_strat_edges = 0;
67 unsigned nb_latches = 0;
68 unsigned nb_gates = 0;
69 bool realizable = false;
70 };
71
73 : force_sbacc{false},
74 s{algo::LAR},
75 minimize_lvl{2},
76 sp{splittype::AUTO},
77 bv{},
78 verbose_stream{nullptr},
79 dict(make_bdd_dict())
80 {
81 }
82
83 bool force_sbacc;
84 algo s;
85 int minimize_lvl;
86 splittype sp;
87 std::optional<bench_var> bv;
88 std::ostream* verbose_stream;
89 option_map opt;
90 bdd_dict_ptr dict;
91 };
92
95
123 SPOT_API twa_graph_ptr
124 split_2step(const const_twa_graph_ptr& aut,
125 const bdd& output_bdd, bool complete_env = true,
126 synthesis_info::splittype sp
127 = synthesis_info::splittype::AUTO);
128
132 SPOT_API twa_graph_ptr
133 split_2step(const const_twa_graph_ptr& aut, bool complete_env = true,
134 synthesis_info::splittype sp
135 = synthesis_info::splittype::AUTO);
136
142 SPOT_API twa_graph_ptr
143 split_2step(const const_twa_graph_ptr& aut,
144 synthesis_info& gi);
145
146
155 SPOT_API twa_graph_ptr
156 unsplit_2step(const const_twa_graph_ptr& aut);
157
160 SPOT_API std::ostream&
161 operator<<(std::ostream& os, synthesis_info::algo s);
162
165 SPOT_API std::ostream &
166 operator<<(std::ostream &os, const synthesis_info &gi);
167
168
180 SPOT_API twa_graph_ptr
182 const std::vector<std::string>& all_outs,
183 synthesis_info& gi);
184 SPOT_API twa_graph_ptr
186 const std::vector<std::string>& all_outs);
187 SPOT_API twa_graph_ptr
188 ltl_to_game(const std::string& f,
189 const std::vector<std::string>& all_outs,
190 synthesis_info& gi);
191 SPOT_API twa_graph_ptr
192 ltl_to_game(const std::string& f,
193 const std::vector<std::string>& all_outs);
195
204 SPOT_API twa_graph_ptr
205 solved_game_to_mealy(twa_graph_ptr arena, synthesis_info& gi);
206 SPOT_API twa_graph_ptr
207 solved_game_to_mealy(twa_graph_ptr arena);
208 SPOT_API twa_graph_ptr
210 SPOT_API twa_graph_ptr
211 solved_game_to_separated_mealy(twa_graph_ptr arena);
212 SPOT_API twa_graph_ptr
214 SPOT_API twa_graph_ptr
215 solved_game_to_split_mealy(twa_graph_ptr arena);
217
221 struct SPOT_API mealy_like
222 {
223 enum class realizability_code
224 {
225 UNREALIZABLE,
226 UNKNOWN,
227 REALIZABLE_REGULAR,
228 // strat is DTGBA and a glob_cond
229 REALIZABLE_DTGBA
230 };
231
232 realizability_code success;
233 twa_graph_ptr mealy_like;
234 bdd glob_cond;
235 };
236
250 SPOT_API std::pair<std::vector<formula>, std::vector<std::set<formula>>>
251 split_independent_formulas(formula f, const std::vector<std::string>& outs);
252
253 SPOT_API std::pair<std::vector<formula>, std::vector<std::set<formula>>>
254 split_independent_formulas(const std::string& f,
255 const std::vector<std::string>& outs);
257
272 SPOT_API mealy_like
274 const std::vector<std::string>& output_aps,
275 synthesis_info& gi, bool want_strategy = false);
276
282 SPOT_API bool
283 solve_game(twa_graph_ptr arena, synthesis_info& gi);
284
285 struct SPOT_API game_relabeling_map
286 {
287 relabeling_map env_map;
288 relabeling_map player_map;
289 };
290
303 SPOT_API game_relabeling_map
304 partitioned_game_relabel_here(twa_graph_ptr& arena,
305 bool relabel_env,
306 bool relabel_play,
307 bool split_env = false,
308 bool split_play = false,
309 unsigned max_letter = -1u,
310 unsigned max_letter_mult = -1u);
311
316 SPOT_API void
317 relabel_game_here(twa_graph_ptr& arena,
318 game_relabeling_map& rel_maps);
319
320}
Main class for temporal logic formula.
Definition formula.hh:760
Manage a map of options.
Definition optionmap.hh:34
bool solve_game(const twa_graph_ptr &arena)
Generic interface for game solving.
twa_graph_ptr solved_game_to_split_mealy(twa_graph_ptr arena, synthesis_info &gi)
creates a mealy machine from a solved game arena taking into account the options given in gi....
twa_graph_ptr solved_game_to_separated_mealy(twa_graph_ptr arena, synthesis_info &gi)
creates a mealy machine from a solved game arena taking into account the options given in gi....
std::pair< std::vector< formula >, std::vector< std::set< formula > > > split_independent_formulas(formula f, const std::vector< std::string > &outs)
Seeks to decompose a formula into independently synthetizable sub-parts. The conjunction of all sub-p...
twa_graph_ptr split_2step(const const_twa_graph_ptr &aut, const bdd &output_bdd, bool complete_env=true, synthesis_info::splittype sp=synthesis_info::splittype::AUTO)
make each transition a 2-step transition, transforming the graph into an alternating arena
twa_graph_ptr unsplit_2step(const const_twa_graph_ptr &aut)
the inverse of split_2step
game_relabeling_map partitioned_game_relabel_here(twa_graph_ptr &arena, bool relabel_env, bool relabel_play, bool split_env=false, bool split_play=false, unsigned max_letter=-1u, unsigned max_letter_mult=-1u)
Tries to relabel a SPLIT game arena using fresh propositions. Can be applied to env or player dependi...
twa_graph_ptr ltl_to_game(const formula &f, const std::vector< std::string > &all_outs, synthesis_info &gi)
Creates a game from a specification and a set of output propositions.
mealy_like try_create_direct_strategy(formula f, const std::vector< std::string > &output_aps, synthesis_info &gi, bool want_strategy=false)
Creates a strategy for the formula given by calling all intermediate steps.
twa_graph_ptr solved_game_to_mealy(twa_graph_ptr arena, synthesis_info &gi)
creates a mealy machine from a solved game arena taking into account the options given in gi....
void relabel_game_here(twa_graph_ptr &arena, game_relabeling_map &rel_maps)
Undoes a relabeling done by partitioned_game_relabel_here. A dedicated function is necessary in order...
Definition automata.hh:26
Definition synthesis.hh:286
A struct that represents different types of mealy like objects.
Definition synthesis.hh:222
Definition synthesis.hh:52
Benchmarking data and options for synthesis.
Definition synthesis.hh:32

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Fri Feb 27 2015 10:00:07 for spot by doxygen 1.9.8