spot 2.11.2.dev
translate.hh
1// -*- coding: utf-8 -*-
2// Copyright (C) 2013-2018, 2020, 2022 Laboratoire de Recherche et Développement
3// 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/twaalgos/postproc.hh>
23#include <spot/tl/simplify.hh>
24
25namespace spot
26{
64 class SPOT_API translator: protected postprocessor
65 {
66 public:
67 translator(tl_simplifier* simpl, const option_map* opt = nullptr)
68 : postprocessor(opt), simpl_(simpl), simpl_owned_(nullptr)
69 {
70 SPOT_ASSERT(simpl);
71 setup_opt(opt);
72 }
73
74 translator(const bdd_dict_ptr& dict, const option_map* opt = nullptr)
75 : postprocessor(opt)
76 {
77 setup_opt(opt);
78 build_simplifier(dict);
79 }
80
81 translator(const option_map* opt = nullptr)
82 : postprocessor(opt)
83 {
84 setup_opt(opt);
85 build_simplifier(make_bdd_dict());
86 }
87
89 {
90 // simpl_owned_ is 0 if simpl_ was supplied to the constructor.
91 delete simpl_owned_;
92 }
93
94 using postprocessor::output_type;
95
96 void
97 set_type(output_type type)
98 {
99 this->postprocessor::set_type(type);
100 }
101
102 using postprocessor::output_pref;
103
104 void
105 set_pref(output_pref pref)
106 {
107 this->postprocessor::set_pref(pref);
108 }
109
110 using postprocessor::optimization_level;
111
112 void
113 set_level(optimization_level level)
114 {
115 level_ = level;
116 if (simpl_owned_)
117 {
118 auto d = simpl_owned_->get_dict();
119 delete simpl_owned_;
120 build_simplifier(d);
121 }
122 if (!gf_guarantee_set_)
123 gf_guarantee_ = level != Low;
124 }
125
129 twa_graph_ptr run(formula f);
130
135 twa_graph_ptr run(formula* f);
136
139
140 protected:
141 void setup_opt(const option_map* opt);
142 void build_simplifier(const bdd_dict_ptr& dict);
143 twa_graph_ptr run_aux(formula f);
144
145 private:
146 tl_simplifier* simpl_;
147 tl_simplifier* simpl_owned_;
148 int comp_susp_;
149 int early_susp_;
150 int skel_wdba_;
151 int skel_simul_;
152 int relabel_bool_;
153 int tls_impl_;
154 bool gf_guarantee_ = true;
155 bool gf_guarantee_set_ = false;
156 bool ltl_split_;
157 int branchpost_ = -1;
158 unsigned tls_max_states_ = 0;
159 int exprop_;
160 const option_map* opt_;
161 };
163
164}
Main class for temporal logic formula.
Definition: formula.hh:715
Manage a map of options.
Definition: optionmap.hh:38
Wrap TGBA/BA/Monitor post-processing algorithms in an easy interface.
Definition: postproc.hh:67
void set_pref(output_pref pref)
Select the desired characteristics of the output automaton.
Definition: postproc.hh:197
void set_type(output_type type)
Select the desired output type.
Definition: postproc.hh:139
Rewrite or simplify f in various ways.
Definition: simplify.hh:107
Translate an LTL formula into an optimized spot::tgba.
Definition: translate.hh:65
twa_graph_ptr run(formula f)
Convert f into an automaton.
void clear_caches()
Clear the LTL simplification caches.
twa_graph_ptr run(formula *f)
Convert f into an automaton, and update f.
Definition: automata.hh:27

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