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 Non-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
32namespace 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 uses dynamic cast to figure wheter to
43 * to output a Buechi or a Rabin automaton
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 */
54extern FAUDES_API void ExportHoa(
55 std::ostream& rOutStream,
56 const Generator& rAut,
57 SymbolTable* pSymTab=nullptr);
58
59
60/**
61 * Export Automaton as HOA formated stream
62 *
63 * Convenience wrapper, for detail see ExportHoa(std::ostream&, const Generator&)
64 *
65 * @param rFilename
66 * File to write to
67 * @param rAut
68 * Automaton to write
69 * @param pSymTab
70 * Optional symbol table to record event mapping
71 *
72 * @ingroup OmgPlugin
73 */
74extern FAUDES_API void ExportHoa(
75 const std::string& rFilename,
76 const Generator& rAut,
77 SymbolTable* pSymTab=nullptr);
78
79
80/**
81 * Import Automaton from HOA formated stream
82 *
83 * To reading input in HAO format we use the cpphoafparser library,
84 * authored/copyrighted by
85 *
86 * Joachim Klein <klein@tcs.inf.tu-dresden.de>
87 * David Mueller <david.mueller@tcs.inf.tu-dresden.de>
88 *
89 * We have found the original sources at
90 *
91 * http://automata.tools/hoa/cpphoafparser
92 *
93 * They are distributed under LGPL v2.1 conditions and we include
94 * them with libFAUDES under the same license terms.
95 *
96 * Our current implementation can read Rabin and Buechi automata, preferably
97 * with implicit edges. This is not a restriction of cpphoafparser
98 * and may be extended for further use cases in future.
99 *
100 * @param rInStream
101 * Stream to read from
102 * @param rGen
103 * Resultimg automaton
104 * @param pSymTab
105 * Optional symbol table to provide event mapping
106 * @param resolve
107 * Ask cpphoafparser to resolve aliase
108 * @param trace
109 * Ask cpphoafparser for a parse trace on std::cerr
110 *
111 * @ingroup OmgPlugin
112 */
113extern FAUDES_API void ImportHoa(
114 std::istream& rInStream,
115 Generator& rGen,
116 const SymbolTable* pSymTab=nullptr,
117 bool resolve=false,
118 bool trace=false);
119
120
121/**
122 * Import Automaton from HOA formated file
123 *
124 * Convenience wrapper, see ImportHoa(std::istream&,RabinAutomaton&) for details.
125 *
126 * @param rFilename
127 * File to read from
128 * @param rGen
129 * Resultimg automaton
130 * @param pSymTab
131 * Optional symbol table to provide event mapping
132 * @param resolve
133 * Ask cpphoafparser to resolve aliases
134 * @param trace
135 * Ask cpphoafparser for a parse trace on std::cerr
136 *
137 * @ingroup OmgPlugin
138 */
139extern FAUDES_API void ImportHoa(
140 const std::string& rFilename,
141 Generator& rGen,
142 const SymbolTable* pSymTab=nullptr,
143 bool resolve=false,
144 bool trace=false);
145
146} // namespace faudes
147
148#endif
149
#define FAUDES_API
vGenerator Generator
void ExportHoa(std::ostream &rOutStream, const Generator &rAut, SymbolTable *pSymTab)
Definition omg_hoa.cpp:187
void ImportHoa(std::istream &rInStream, Generator &rGen, const SymbolTable *pSymTab, bool resolve, bool trace)
Definition omg_hoa.cpp:503

libFAUDES 2.33k --- 2025.09.16 --- c++ api documentaion by doxygen