spot  1.99.4
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
common_trans.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2015 Laboratoire de Recherche et Développement de
3 // 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 "common_sys.hh"
23 #include <vector>
24 #include <argp.h>
25 
26 #include "misc/formater.hh"
27 #include "misc/tmpfile.hh"
28 #include "twa/twagraph.hh"
29 
30 
31 extern const struct argp trans_argp;
32 
34 {
35  // The translator command, as specified on the command-line.
36  // If this has the form of
37  // {name}cmd
38  // then it is split in two components.
39  // Otherwise, spec=cmd=name.
40  const char* spec;
41  // actual shell command (or spec)
42  const char* cmd;
43  // name of the translator (or spec)
44  const char* name;
45 
46  translator_spec(const char* spec);
47  translator_spec(const translator_spec& other);
48  ~translator_spec();
49 };
50 
51 extern std::vector<translator_spec> translators;
52 
53 struct quoted_string final: public spot::printable_value<std::string>
54 {
56  void print(std::ostream& os, const char* pos) const override;
57 };
58 
60  public spot::printable_value<spot::temporary_file*>
61 {
62  unsigned translator_num;
63 
66  void reset(unsigned n);
67  void cleanup();
68 
69  void print(std::ostream& os, const char* pos) const override;
70 };
71 
72 
74 {
75 protected:
76  spot::bdd_dict_ptr dict;
77  // Round-specific variables
78  quoted_string string_ltl_spot;
79  quoted_string string_ltl_spin;
80  quoted_string string_ltl_lbt;
81  quoted_string string_ltl_wring;
82  quoted_string filename_ltl_spot;
83  quoted_string filename_ltl_spin;
84  quoted_string filename_ltl_lbt;
85  quoted_string filename_ltl_wring;
86  // Run-specific variables
88 public:
89  using spot::formater::has;
90 
91  translator_runner(spot::bdd_dict_ptr dict,
92  // whether we accept the absence of output
93  // specifier
94  bool no_output_allowed = false);
95  void string_to_tmp(std::string& str, unsigned n, std::string& tmpname);
96  const std::string& formula() const;
97  void round_formula(spot::formula f, unsigned serial);
98 };
99 
100 
101 // Disable handling of timeout on systems that miss kill() or alarm().
102 // For instance MinGW.
103 #if HAVE_KILL && HAVE_ALARM
104 # define ENABLE_TIMEOUT 1
105 #else
106 # define ENABLE_TIMEOUT 0
107 #endif
108 
109 extern volatile bool timed_out;
110 extern unsigned timeout_count;
111 #if ENABLE_TIMEOUT
112 void setup_sig_handler();
113 int exec_with_timeout(const char* cmd);
114 #else // !ENABLE_TIMEOUT
115 #define exec_with_timeout(cmd) system(cmd)
116 #define setup_sig_handler() while (0);
117 #endif // !ENABLE_TIMEOUT
Definition: common_trans.hh:59
Definition: formater.hh:42
Definition: common_trans.hh:53
Definition: common_trans.hh:73
Main class for temporal logic formula.
Definition: formula.hh:574
bool has(char c) const
Whether c occurred in the primed formats.
Definition: formater.hh:149
Definition: common_trans.hh:33
Definition: formater.hh:104

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Thu Oct 1 2015 05:49:14 for spot by doxygen 1.8.8