spot 2.11.2.dev
synthesis.hh
1// -*- coding: utf-8 -*-
2// Copyright (C) 2020-2022 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
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_independant_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_independant_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}
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
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_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.
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....
Definition: automata.hh:27
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