spot 2.12.2
translate.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/twaalgos/postproc.hh>
22#include <spot/tl/simplify.hh>
23
24namespace spot
25{
63 class SPOT_API translator: protected postprocessor
64 {
65 public:
66 translator(tl_simplifier* simpl, const option_map* opt = nullptr)
67 : postprocessor(opt), simpl_(simpl), simpl_owned_(nullptr)
68 {
69 SPOT_ASSERT(simpl);
70 setup_opt(opt);
71 }
72
73 translator(const bdd_dict_ptr& dict, const option_map* opt = nullptr)
74 : postprocessor(opt)
75 {
76 setup_opt(opt);
77 build_simplifier(dict);
78 }
79
80 translator(const option_map* opt = nullptr)
81 : postprocessor(opt)
82 {
83 setup_opt(opt);
84 build_simplifier(make_bdd_dict());
85 }
86
88 {
89 // simpl_owned_ is 0 if simpl_ was supplied to the constructor.
90 delete simpl_owned_;
91 }
92
93 using postprocessor::output_type;
94
95 void
96 set_type(output_type type)
97 {
98 this->postprocessor::set_type(type);
99 }
100
101 using postprocessor::output_pref;
102
103 void
104 set_pref(output_pref pref)
105 {
106 this->postprocessor::set_pref(pref);
107 }
108
109 using postprocessor::optimization_level;
110
111 void
112 set_level(optimization_level level)
113 {
114 level_ = level;
115 if (simpl_owned_)
116 {
117 auto d = simpl_owned_->get_dict();
118 delete simpl_owned_;
119 build_simplifier(d);
120 }
121 if (!gf_guarantee_set_)
122 gf_guarantee_ = level != Low;
123 }
124
128 twa_graph_ptr run(formula f);
129
134 twa_graph_ptr run(formula* f);
135
138
139 protected:
140 void setup_opt(const option_map* opt);
141 void build_simplifier(const bdd_dict_ptr& dict);
142 twa_graph_ptr run_aux(formula f);
143
144 private:
145 tl_simplifier* simpl_;
146 tl_simplifier* simpl_owned_;
147 int comp_susp_;
148 int early_susp_;
149 int skel_wdba_;
150 int skel_simul_;
151 int relabel_bool_;
152 int relabel_overlap_;
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_ = 64;
159 unsigned tls_max_ops_ = 16;
160 int exprop_;
161 const option_map* opt_;
162 };
164
165}
Main class for temporal logic formula.
Definition: formula.hh:732
Manage a map of options.
Definition: optionmap.hh:34
Wrap TGBA/BA/Monitor post-processing algorithms in an easy interface.
Definition: postproc.hh:66
void set_pref(output_pref pref)
Select the desired characteristics of the output automaton.
Definition: postproc.hh:196
void set_type(output_type type)
Select the desired output type.
Definition: postproc.hh:138
Rewrite or simplify f in various ways.
Definition: simplify.hh:109
Translate an LTL formula into an optimized spot::tgba.
Definition: translate.hh:64
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:26

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