spot  2.10.4.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 = 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  };
90 
91  struct bench_var
92  {
93  double total_time = 0.0;
94  double trans_time = 0.0;
95  double split_time = 0.0;
96  double paritize_time = 0.0;
97  double solve_time = 0.0;
98  double strat2aut_time = 0.0;
99  double simplify_strat_time = 0.0;
100  double aig_time = 0.0;
101  unsigned nb_states_arena = 0;
102  unsigned nb_states_arena_env = 0;
103  unsigned nb_strat_states = 0;
104  unsigned nb_strat_edges = 0;
105  unsigned nb_simpl_strat_states = 0;
106  unsigned nb_simpl_strat_edges = 0;
107  unsigned nb_latches = 0;
108  unsigned nb_gates = 0;
109  bool realizable = false;
110  };
111 
113  : force_sbacc{false},
114  s{algo::LAR},
115  minimize_lvl{2},
116  bv{},
117  verbose_stream{nullptr},
118  dict(make_bdd_dict())
119  {
120  }
121 
122  bool force_sbacc;
123  algo s;
124  int minimize_lvl;
125  std::optional<bench_var> bv;
126  std::ostream* verbose_stream;
127  option_map opt;
128  bdd_dict_ptr dict;
129  };
130 
133  SPOT_API std::ostream&
134  operator<<(std::ostream& os, synthesis_info::algo s);
135 
138  SPOT_API std::ostream &
139  operator<<(std::ostream &os, const synthesis_info &gi);
140 
141 
153  SPOT_API twa_graph_ptr
155  const std::vector<std::string>& all_outs,
156  synthesis_info& gi);
157  SPOT_API twa_graph_ptr
159  const std::vector<std::string>& all_outs);
160  SPOT_API twa_graph_ptr
161  ltl_to_game(const std::string& f,
162  const std::vector<std::string>& all_outs,
163  synthesis_info& gi);
164  SPOT_API twa_graph_ptr
165  ltl_to_game(const std::string& f,
166  const std::vector<std::string>& all_outs);
168 
177  SPOT_API twa_graph_ptr
178  solved_game_to_mealy(twa_graph_ptr arena, synthesis_info& gi);
179  SPOT_API twa_graph_ptr
180  solved_game_to_mealy(twa_graph_ptr arena);
181  SPOT_API twa_graph_ptr
183  SPOT_API twa_graph_ptr
184  solved_game_to_separated_mealy(twa_graph_ptr arena);
185  SPOT_API twa_graph_ptr
186  solved_game_to_split_mealy(twa_graph_ptr arena, synthesis_info& gi);
187  SPOT_API twa_graph_ptr
188  solved_game_to_split_mealy(twa_graph_ptr arena);
190 
194  struct SPOT_API mealy_like
195  {
196  enum class realizability_code
197  {
198  UNREALIZABLE,
199  UNKNOWN,
200  REALIZABLE_REGULAR,
201  // strat is DTGBA and a glob_cond
202  REALIZABLE_DTGBA
203  };
204 
205  realizability_code success;
206  twa_graph_ptr mealy_like;
207  bdd glob_cond;
208  };
209 
223  SPOT_API std::pair<std::vector<formula>, std::vector<std::set<formula>>>
224  split_independant_formulas(formula f, const std::vector<std::string>& outs);
225 
226  SPOT_API std::pair<std::vector<formula>, std::vector<std::set<formula>>>
227  split_independant_formulas(const std::string& f,
228  const std::vector<std::string>& outs);
230 
243  SPOT_API mealy_like
245  const std::vector<std::string>& output_aps,
246  synthesis_info& gi);
247 
253  SPOT_API bool
254  solve_game(twa_graph_ptr arena, synthesis_info& gi);
255 
256 }
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 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....
twa_graph_ptr unsplit_2step(const const_twa_graph_ptr &aut)
the inverse 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 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....
mealy_like 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 mealy like objects.
Definition: synthesis.hh:195
Definition: synthesis.hh:92
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.1