spot 2.12.2
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{
30
57 SPOT_API twa_graph_ptr
58 split_2step(const const_twa_graph_ptr& aut,
59 const bdd& output_bdd, bool complete_env = true);
60
64 SPOT_API twa_graph_ptr
65 split_2step(const const_twa_graph_ptr& aut, bool complete_env = true);
66
75 SPOT_API twa_graph_ptr
76 unsplit_2step(const const_twa_graph_ptr& aut);
77
80 struct SPOT_API synthesis_info
81 {
82 enum class algo
83 {
84 DET_SPLIT=0,
85 SPLIT_DET,
86 DPA_SPLIT,
87 LAR,
88 LAR_OLD,
89 ACD,
90 };
91
92 struct bench_var
93 {
94 double total_time = 0.0;
95 double trans_time = 0.0;
96 double split_time = 0.0;
97 double paritize_time = 0.0;
98 double solve_time = 0.0;
99 double strat2aut_time = 0.0;
100 double simplify_strat_time = 0.0;
101 double aig_time = 0.0;
102 unsigned nb_states_arena = 0;
103 unsigned nb_states_arena_env = 0;
104 unsigned nb_strat_states = 0;
105 unsigned nb_strat_edges = 0;
106 unsigned nb_simpl_strat_states = 0;
107 unsigned nb_simpl_strat_edges = 0;
108 unsigned nb_latches = 0;
109 unsigned nb_gates = 0;
110 bool realizable = false;
111 };
112
114 : force_sbacc{false},
115 s{algo::LAR},
116 minimize_lvl{2},
117 bv{},
118 verbose_stream{nullptr},
119 dict(make_bdd_dict())
120 {
121 }
122
123 bool force_sbacc;
124 algo s;
125 int minimize_lvl;
126 std::optional<bench_var> bv;
127 std::ostream* verbose_stream;
128 option_map opt;
129 bdd_dict_ptr dict;
130 };
131
134 SPOT_API std::ostream&
135 operator<<(std::ostream& os, synthesis_info::algo s);
136
139 SPOT_API std::ostream &
140 operator<<(std::ostream &os, const synthesis_info &gi);
141
142
154 SPOT_API twa_graph_ptr
156 const std::vector<std::string>& all_outs,
157 synthesis_info& gi);
158 SPOT_API twa_graph_ptr
160 const std::vector<std::string>& all_outs);
161 SPOT_API twa_graph_ptr
162 ltl_to_game(const std::string& f,
163 const std::vector<std::string>& all_outs,
164 synthesis_info& gi);
165 SPOT_API twa_graph_ptr
166 ltl_to_game(const std::string& f,
167 const std::vector<std::string>& all_outs);
169
178 SPOT_API twa_graph_ptr
179 solved_game_to_mealy(twa_graph_ptr arena, synthesis_info& gi);
180 SPOT_API twa_graph_ptr
181 solved_game_to_mealy(twa_graph_ptr arena);
182 SPOT_API twa_graph_ptr
184 SPOT_API twa_graph_ptr
185 solved_game_to_separated_mealy(twa_graph_ptr arena);
186 SPOT_API twa_graph_ptr
188 SPOT_API twa_graph_ptr
189 solved_game_to_split_mealy(twa_graph_ptr arena);
191
195 struct SPOT_API mealy_like
196 {
197 enum class realizability_code
198 {
199 UNREALIZABLE,
200 UNKNOWN,
201 REALIZABLE_REGULAR,
202 // strat is DTGBA and a glob_cond
203 REALIZABLE_DTGBA
204 };
205
206 realizability_code success;
207 twa_graph_ptr mealy_like;
208 bdd glob_cond;
209 };
210
224 SPOT_API std::pair<std::vector<formula>, std::vector<std::set<formula>>>
225 split_independent_formulas(formula f, const std::vector<std::string>& outs);
226
227 SPOT_API std::pair<std::vector<formula>, std::vector<std::set<formula>>>
228 split_independent_formulas(const std::string& f,
229 const std::vector<std::string>& outs);
231
246 SPOT_API mealy_like
248 const std::vector<std::string>& output_aps,
249 synthesis_info& gi, bool want_strategy = false);
250
256 SPOT_API bool
257 solve_game(twa_graph_ptr arena, synthesis_info& gi);
258
259 struct SPOT_API game_relabeling_map
260 {
261 relabeling_map env_map;
262 relabeling_map player_map;
263 };
264
277 SPOT_API game_relabeling_map
278 partitioned_game_relabel_here(twa_graph_ptr& arena,
279 bool relabel_env,
280 bool relabel_play,
281 bool split_env = false,
282 bool split_play = false,
283 unsigned max_letter = -1u,
284 unsigned max_letter_mult = -1u);
285
290 SPOT_API void
291 relabel_game_here(twa_graph_ptr& arena,
292 game_relabeling_map& rel_maps);
293
294}
Main class for temporal logic formula.
Definition: formula.hh:732
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 split_2step(const const_twa_graph_ptr &aut, const bdd &output_bdd, bool complete_env=true)
make each transition a 2-step transition, transforming the graph into an alternating arena
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 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:260
A struct that represents different types of mealy like objects.
Definition: synthesis.hh:196
Definition: synthesis.hh:93
Benchmarking data and options for synthesis.
Definition: synthesis.hh:81

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.4