omg_hoa.h
Go to the documentation of this file.
1 /** @file omg_hoa.h Serialisation in HOA format */
2 
3 /*
4 
5  FAU Discrete Event Systems Library (libfaudes)
6 
7  Copyright (C) 2025 Thomas Moor
8  Exclusive copyright is granted to Klaus Schmidt
9 
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Lesser General Public
12  License as published by the Free Software Foundation; either
13  version 2.1 of the License, or (at your option) any later version.
14 
15  This library is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public
21  License along with this library; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 */
24 
25 
26 #ifndef FAUDES_OMG_HOA_H
27 #define FAUDES_OMG_HOA_H
28 
29 #include "corefaudes.h"
30 #include "omg_rabinaut.h"
31 
32 namespace faudes {
33 
34 
35 /**
36  * Export Automaton as HOA formated stream
37  *
38  * We iterate over all relevant entities of the specified automaton
39  * and somewhat adboc writes HOA formated entities to the specified
40  * stream.
41  *
42  * Our current implementation is restricted to (nondetermistic) Buechi
43  * automata.
44  *
45  * @param rOutStream
46  * Stream to write to
47  * @param rAut
48  * Automaton to write
49  * @param pSymTab
50  * Optional symbol table to record event mapping
51  *
52  * @ingroup OmgPlugin
53  */
54 extern FAUDES_API void ExportHoa(
55  std::ostream& rOutStream,
56  const Generator& rAut,
57  SymbolTable* pSymTab=nullptr);
58 
59 /**
60  * Export Automaton as HOA formated stream
61  *
62  * Convenience wrapper, for detail see ExportHoa(std::ostream&, const Generator&)
63  *
64  * @param rFilename
65  * File to write to
66  * @param rAut
67  * Automaton to write
68  * @param pSymTab
69  * Optional symbol table to record event mapping
70  *
71  * @ingroup OmgPlugin
72  */
73 extern FAUDES_API void ExportHoa(
74  const std::string& rFilename,
75  const Generator& rAut,
76  SymbolTable* pSymTab=nullptr);
77 
78 
79 /**
80  * Import Automaton from HOA formated stream
81  *
82  * To reading input in HAO format we use the cpphoafparser library,
83  * authored/copyrighted by
84  *
85  * Joachim Klein <klein@tcs.inf.tu-dresden.de>
86  * DDavid Mueller <david.mueller@tcs.inf.tu-dresden.de>
87  *
88  * We have found the original sources at
89  *
90  * http://automata.tools/hoa/cpphoafparser
91  *
92  * They are distributed under LGPL v2.1 conditions and we include
93  * them with libFAUDES under the same license terms.
94  *
95  * Our current implementation can read deterministic Rabin automata
96  * with implicit edges. This is not a restriction of cpphoafparser
97  * and we extend for further use cases in future.
98  *
99  * @param rInStream
100  * Stream to read from
101  * @param rAut
102  * Resultimg automaton
103  * @param pSymTab
104  * Optional symbol table to provide event mapping
105  * @param resolve
106  * Ask cpphoafparser to resolve aliase
107  * @param trace
108  * Ask cpphoafparser for a parse trace on std::cerr
109  *
110  * @ingroup OmgPlugin
111  */
112 extern FAUDES_API void ImportHoa(
113  std::istream& rInStream,
114  RabinAutomaton& rAut,
115  const SymbolTable* pSymTab=nullptr,
116  bool resolve=false,
117  bool trace=false);
118 
119 
120 /**
121  * Import Automaton from HOA formated file
122  *
123  * Convenience wrapper, see ImportHoa(std::istream&,RabinAutomaton&) for details.
124  *
125  * @param rFilename
126  * File to read from
127  * @param rAut
128  * Resultimg automaton
129  * @param pSymTab
130  * Optional symbol table to provide event mapping
131  * @param resolve
132  * Ask cpphoafparser to resolve aliase
133  * @param trace
134  * Ask cpphoafparser for a parse trace on std::cerr
135  *
136  * @ingroup OmgPlugin
137  */
138 extern FAUDES_API void ImportHoa(
139  const std::string& rFilename,
140  RabinAutomaton& rAut,
141  const SymbolTable* pSymTab=nullptr,
142  bool resolve=false,
143  bool trace=false);
144 
145 } // namespace faudes
146 
147 #endif
148 
#define FAUDES_API
Definition: cfl_platform.h:80
vGenerator Generator
void ExportHoa(std::ostream &rOutStream, const Generator &rAut, SymbolTable *pSymTab)
Definition: omg_hoa.cpp:133
void ImportHoa(std::istream &rInStream, RabinAutomaton &rAut, const SymbolTable *pSymTab, bool resolve, bool trace)
Definition: omg_hoa.cpp:364
TrGenerator< RabinAcceptance, AttributeVoid, AttributeCFlags, AttributeVoid > RabinAutomaton
Definition: omg_rabinaut.h:224

libFAUDES 2.33h --- 2025.06.18 --- c++ api documentaion by doxygen