LydiaSyft
Parser.h
1 //
2 // Created by shuzhu on 18/05/23.
3 //
4 
5 #ifndef LYDIASYFT_APARSER_H
6 #define LYDIASYFT_APARSER_H
7 
8 #include <stdexcept>
9 #include <vector>
10 
11 namespace Syft {
12 
16  class Parser {
17  private:
18 
19  std::vector<std::string> input_variables;
20  std::vector<std::string> output_variables;
21  std::string formula;
22  bool sys_first;
23 
24  std::string exec(const char* cmd);
25  std::string ltrim(const std::string &s);
26 
27  std::string rtrim(const std::string &s);
28 
29  std::string trim(const std::string &s);
30 
31  public:
32 
36  Parser();
37 
42  static Parser read_from_file(const std::string &syfco_location, const std::string &filename);
43 
47  std::vector<std::string> get_input_variables() const;
48 
52  std::vector<std::string> get_output_variables() const;
53 
57  std::string get_formula() const;
58 
62  bool get_sys_first() const;
63  };
64 
65 }
66 
67 #endif //LYDIASYFT_APARSER_H
A parser for reading LTLf synthesis benchmarks in TLSF format.
Definition: Parser.h:16
std::vector< std::string > get_output_variables() const
Return output variables in a vector.
Definition: Parser.cpp:73
std::vector< std::string > get_input_variables() const
Return input variables in a vector.
Definition: Parser.cpp:69
std::string get_formula() const
Return the formula.
Definition: Parser.cpp:77
Parser()
Creates a parser with no items.
Definition: Parser.cpp:15
static Parser read_from_file(const std::string &syfco_location, const std::string &filename)
Obtain an LTLf formula and construct a partition from a TLSF file.
Definition: Parser.cpp:30
bool get_sys_first() const
Return true if the target is a Moore machine.
Definition: Parser.cpp:81