spot  2.9.8.dev
synthesis.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2020-2021 Laboratoire de Recherche et
3 // Développement de l'Epita (LRDE).
4 //
5 // This file is part of Spot, a model checking library.
6 //
7 // Spot is free software; you can redistribute it and/or modify it
8 // under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // Spot is distributed in the hope that it will be useful, but WITHOUT
13 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 // License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 
20 #pragma once
21 
22 #include <spot/twa/twagraph.hh>
23 #include <spot/twaalgos/game.hh>
24 #include <bddx.h>
25 
26 namespace 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);
60 
61 
74  SPOT_API void
75  split_2step_fast_here(const twa_graph_ptr& aut, const bdd& output_bdd);
76 
77  SPOT_API twa_graph_ptr
78  split_2step_fast(const const_twa_graph_ptr& aut, const bdd& output_bdd);
80 
85  SPOT_API twa_graph_ptr
86  unsplit_2step(const const_twa_graph_ptr& aut);
87 
90  struct SPOT_API synthesis_info
91  {
92  enum class algo
93  {
94  DET_SPLIT=0,
95  SPLIT_DET,
96  DPA_SPLIT,
97  LAR,
98  LAR_OLD,
99  };
100 
101  struct bench_var
102  {
103  double total_time = 0.0;
104  double trans_time = 0.0;
105  double split_time = 0.0;
106  double paritize_time = 0.0;
107  double solve_time = 0.0;
108  double strat2aut_time = 0.0;
109  double aig_time = 0.0;
110  unsigned nb_states_arena = 0;
111  unsigned nb_states_arena_env = 0;
112  unsigned nb_strat_states = 0;
113  unsigned nb_strat_edges = 0;
114  unsigned nb_latches = 0;
115  unsigned nb_gates = 0;
116  bool realizable = false;
117  };
118 
120  : force_sbacc{false},
121  s{algo::LAR},
122  minimize_lvl{2},
123  bv{},
124  verbose_stream{nullptr},
125  dict(make_bdd_dict())
126  {
127  }
128 
129  bool force_sbacc;
130  algo s;
131  int minimize_lvl;
132  std::optional<bench_var> bv;
133  std::ostream* verbose_stream;
134  option_map opt;
135  bdd_dict_ptr dict;
136  };
137 
140  SPOT_API std::ostream&
141  operator<<(std::ostream& os, synthesis_info::algo s);
142 
145  SPOT_API std::ostream &
146  operator<<(std::ostream &os, const synthesis_info &gi);
147 
148 
160  SPOT_API twa_graph_ptr
162  const std::vector<std::string>& all_outs,
163  synthesis_info& gi);
164  SPOT_API twa_graph_ptr
166  const std::vector<std::string>& all_outs);
167  SPOT_API twa_graph_ptr
168  ltl_to_game(const std::string& f,
169  const std::vector<std::string>& all_outs,
170  synthesis_info& gi);
171  SPOT_API twa_graph_ptr
172  ltl_to_game(const std::string& f,
173  const std::vector<std::string>& all_outs);
175 
185  SPOT_API spot::twa_graph_ptr
186  apply_strategy(const spot::twa_graph_ptr& arena,
187  bool unsplit, bool keep_acc);
188 
204  SPOT_API void
205  minimize_strategy_here(twa_graph_ptr& strat, int min_lvl);
206 
207  SPOT_API twa_graph_ptr
208  minimize_strategy(const_twa_graph_ptr& strat, int min_lvl);
210 
215  SPOT_API twa_graph_ptr
216  create_strategy(twa_graph_ptr arena, synthesis_info& gi);
217  SPOT_API twa_graph_ptr
218  create_strategy(twa_graph_ptr arena);
220 
224  struct SPOT_API
226  {
227 
228  enum class realizability_code
229  {
230  UNREALIZABLE,
231  UNKNOWN,
232  REALIZABLE_REGULAR,
233  // strat is DTGBA and a glob_cond
234  REALIZABLE_DTGBA
235  };
236 
237  realizability_code success;
238  twa_graph_ptr strat_like;
239  bdd glob_cond;
240  };
241 
255  SPOT_API std::pair<std::vector<formula>, std::vector<std::set<formula>>>
256  split_independant_formulas(formula f, const std::vector<std::string>& outs);
257 
258  SPOT_API std::pair<std::vector<formula>, std::vector<std::set<formula>>>
259  split_independant_formulas(const std::string& f,
260  const std::vector<std::string>& outs);
262 
275  SPOT_API strategy_like_t
277  const std::vector<std::string>& output_aps,
278  synthesis_info& gi);
279 
285  SPOT_API bool
286  solve_game(twa_graph_ptr arena, synthesis_info& gi);
287 
288 }
Main class for temporal logic formula.
Definition: formula.hh:715
Manage a map of options.
Definition: optionmap.hh:38
bool solve_game(const twa_graph_ptr &arena)
Generic interface for game solving.
twa_graph_ptr minimize_strategy(const_twa_graph_ptr &strat, int min_lvl)
Minimizes a strategy. Strategies are infact Mealy machines. So we can use techniques designed for the...
void split_2step_fast_here(const twa_graph_ptr &aut, const bdd &output_bdd)
make each transition a 2-step transition.
twa_graph_ptr unsplit_2step(const const_twa_graph_ptr &aut)
the reverse of split_2step
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.
std::pair< std::vector< formula >, std::vector< std::set< formula > > > split_independant_formulas(formula f, const std::vector< std::string > &outs)
Seeks to decompose a formula into independently synthesizable sub-parts. The conjunction of all sub-p...
twa_graph_ptr split_2step_fast(const const_twa_graph_ptr &aut, const bdd &output_bdd)
make each transition a 2-step transition.
twa_graph_ptr split_2step(const const_twa_graph_ptr &aut, const bdd &output_bdd, bool complete_env)
make each transition a 2-step transition, transforming the graph into an alternating arena
spot::twa_graph_ptr apply_strategy(const spot::twa_graph_ptr &arena, bool unsplit, bool keep_acc)
Takes a solved game and restricts the automaton to the winning strategy of the player.
twa_graph_ptr create_strategy(twa_graph_ptr arena, synthesis_info &gi)
creates a strategy from a solved game taking into account the options given in gi
void minimize_strategy_here(twa_graph_ptr &strat, int min_lvl)
Minimizes a strategy. Strategies are infact Mealy machines. So we can use techniques designed for the...
strategy_like_t try_create_direct_strategy(formula f, const std::vector< std::string > &output_aps, synthesis_info &gi)
Creates a strategy for the formula given by calling all intermediate steps.
Definition: automata.hh:27
A struct that represents different types of strategy like objects.
Definition: synthesis.hh:226
Definition: synthesis.hh:102
Benchmarking data and options for synthesis.
Definition: synthesis.hh:91

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