Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
HOAConsumerDAHeader.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "cpphoafparser/consumer/hoa_consumer.hh"
4
#include "cpphoafparser/util/implicit_edge_helper.hh"
5
#include "
storm/automata/APSet.h
"
6
#include "
storm/automata/DeterministicAutomaton.h
"
7
#include "
storm/automata/HOAHeader.h
"
8
#include "
storm/storage/BitVector.h
"
9
#include "
storm/storage/SparseMatrix.h
"
10
11
#include <boost/optional.hpp>
12
#include <exception>
13
14
namespace
storm
{
15
namespace
automata {
16
17
class
HOAConsumerDAHeader
:
public
cpphoafparser::HOAConsumer {
18
protected
:
19
HOAHeader
header
;
20
21
public
:
22
typedef
std::shared_ptr<HOAConsumerDAHeader>
ptr
;
23
24
struct
header_parsing_done
:
public
std::exception {};
25
26
HOAHeader
&
getHeader
() {
27
return
header
;
28
}
29
30
virtual
bool
parserResolvesAliases
() {
31
return
true
;
32
}
33
35
virtual
void
notifyHeaderStart
(
const
std::string&
/*version*/
) {
36
// TODO: Check version
37
}
38
40
virtual
void
setNumberOfStates
(
unsigned
int
numberOfStates) {
41
header
.
numberOfStates
= numberOfStates;
42
}
43
48
virtual
void
addStartStates
(
const
int_list& stateConjunction) {
49
if
(
header
.
startState
) {
50
throw
std::runtime_error(
"Parsing deterministic HOA automaton: Nondeterministic choice of start states not supported"
);
51
}
52
if
(stateConjunction.size() != 1) {
53
throw
std::runtime_error(
"Parsing deterministic HOA automaton: Conjunctive choice of start states not supported"
);
54
}
55
header
.
startState
= stateConjunction.at(0);
56
}
57
62
virtual
void
setAPs
(
const
std::vector<std::string>& aps) {
63
for
(
const
std::string& ap : aps) {
64
header
.
apSet
.
add
(ap);
65
}
66
}
67
73
virtual
void
setAcceptanceCondition
(
unsigned
int
numberOfSets, acceptance_expr::ptr accExpr) {
74
header
.
numberOfAcceptanceSets
= numberOfSets;
75
header
.
acceptance_expression
= accExpr;
76
}
77
83
virtual
void
provideAcceptanceName
(
const
std::string& name,
const
std::vector<cpphoafparser::IntOrString>& extraInfo) {
84
header
.
accName
= name;
85
header
.
accNameExtraInfo
= extraInfo;
86
}
87
95
virtual
void
addAlias
(
const
std::string& name, label_expr::ptr labelExpr) {
96
// IGNORE
97
(void)name;
98
(void)labelExpr;
99
}
100
104
virtual
void
setName
(
const
std::string&
/*name*/
) {
105
// IGNORE
106
}
107
113
virtual
void
setTool
(
const
std::string&
/*name*/
, std::shared_ptr<std::string>
/*version*/
) {
114
// IGNORE
115
}
116
121
virtual
void
addProperties
(
const
std::vector<std::string>&
/*properties*/
) {
122
// TODO: check supported
123
}
124
130
virtual
void
addMiscHeader
(
const
std::string&
/*name*/
,
const
std::vector<cpphoafparser::IntOrString>&
/*content*/
) {
131
// TODO: Check semantic headers
132
}
133
137
virtual
void
notifyBodyStart
() {
138
throw
header_parsing_done
();
139
}
140
148
virtual
void
addState
(
unsigned
int
/*id*/
, std::shared_ptr<std::string>
/*info*/
, label_expr::ptr
/*labelExpr*/
,
149
std::shared_ptr<int_list>
/*accSignature*/
) {
150
// IGNORE
151
}
152
165
virtual
void
addEdgeImplicit
(
unsigned
int
/*stateId*/
,
const
int_list&
/*conjSuccessors*/
, std::shared_ptr<int_list>
/*accSignature*/
) {
166
// IGNORE
167
}
168
178
virtual
void
addEdgeWithLabel
(
unsigned
int
/*stateId*/
, label_expr::ptr
/*labelExpr*/
,
const
int_list&
/*conjSuccessors*/
,
179
std::shared_ptr<int_list>
/*accSignature*/
) {
180
// IGNORE
181
}
182
187
virtual
void
notifyEndOfState
(
unsigned
int
/*stateId*/
) {
188
// IGNORE
189
}
190
194
virtual
void
notifyEnd
() {}
195
200
virtual
void
notifyAbort
() {
201
throw
std::runtime_error(
"Parsing deterministic automaton: Automaton is incomplete (abort)"
);
202
}
203
208
virtual
void
notifyWarning
(
const
std::string& warning) {
209
// IGNORE
210
(void)warning;
211
}
212
};
213
214
}
// namespace automata
215
}
// namespace storm
APSet.h
BitVector.h
DeterministicAutomaton.h
HOAHeader.h
SparseMatrix.h
storm::automata::APSet::add
void add(const std::string &ap)
Definition
APSet.cpp:24
storm::automata::HOAConsumerDAHeader
Definition
HOAConsumerDAHeader.h:17
storm::automata::HOAConsumerDAHeader::notifyEndOfState
virtual void notifyEndOfState(unsigned int)
Called by the parser to notify the consumer that the definition for state stateId has ended [multiple...
Definition
HOAConsumerDAHeader.h:187
storm::automata::HOAConsumerDAHeader::addEdgeImplicit
virtual void addEdgeImplicit(unsigned int, const int_list &, std::shared_ptr< int_list >)
Called by the parser for each implicit edge definition [multiple], i.e., where the edge label is dedu...
Definition
HOAConsumerDAHeader.h:165
storm::automata::HOAConsumerDAHeader::addStartStates
virtual void addStartStates(const int_list &stateConjunction)
Called by the parser for each "Start: state-conj" item [optional, multiple].
Definition
HOAConsumerDAHeader.h:48
storm::automata::HOAConsumerDAHeader::notifyBodyStart
virtual void notifyBodyStart()
Called by the parser to notify that the BODY of the automaton has started [mandatory,...
Definition
HOAConsumerDAHeader.h:137
storm::automata::HOAConsumerDAHeader::addState
virtual void addState(unsigned int, std::shared_ptr< std::string >, label_expr::ptr, std::shared_ptr< int_list >)
Called by the parser for each "State: ..." item [multiple].
Definition
HOAConsumerDAHeader.h:148
storm::automata::HOAConsumerDAHeader::setAPs
virtual void setAPs(const std::vector< std::string > &aps)
Called by the parser for the "AP: ap-def" item [optional, once].
Definition
HOAConsumerDAHeader.h:62
storm::automata::HOAConsumerDAHeader::header
HOAHeader header
Definition
HOAConsumerDAHeader.h:19
storm::automata::HOAConsumerDAHeader::addProperties
virtual void addProperties(const std::vector< std::string > &)
Called by the parser for the "properties: ..." item [optional, multiple].
Definition
HOAConsumerDAHeader.h:121
storm::automata::HOAConsumerDAHeader::notifyHeaderStart
virtual void notifyHeaderStart(const std::string &)
Called by the parser for the "HOA: version" item [mandatory, once].
Definition
HOAConsumerDAHeader.h:35
storm::automata::HOAConsumerDAHeader::setName
virtual void setName(const std::string &)
Called by the parser for the "name: ..." item [optional, once].
Definition
HOAConsumerDAHeader.h:104
storm::automata::HOAConsumerDAHeader::addAlias
virtual void addAlias(const std::string &name, label_expr::ptr labelExpr)
Called by the parser for each "Alias: alias-def" item [optional, multiple].
Definition
HOAConsumerDAHeader.h:95
storm::automata::HOAConsumerDAHeader::addEdgeWithLabel
virtual void addEdgeWithLabel(unsigned int, label_expr::ptr, const int_list &, std::shared_ptr< int_list >)
Called by the parser for each explicit edge definition [optional, multiple], i.e.,...
Definition
HOAConsumerDAHeader.h:178
storm::automata::HOAConsumerDAHeader::addMiscHeader
virtual void addMiscHeader(const std::string &, const std::vector< cpphoafparser::IntOrString > &)
Called by the parser for each unknown header item [optional, multiple].
Definition
HOAConsumerDAHeader.h:130
storm::automata::HOAConsumerDAHeader::parserResolvesAliases
virtual bool parserResolvesAliases()
Definition
HOAConsumerDAHeader.h:30
storm::automata::HOAConsumerDAHeader::setAcceptanceCondition
virtual void setAcceptanceCondition(unsigned int numberOfSets, acceptance_expr::ptr accExpr)
Called by the parser for the "Acceptance: acceptance-def" item [mandatory, once].
Definition
HOAConsumerDAHeader.h:73
storm::automata::HOAConsumerDAHeader::notifyAbort
virtual void notifyAbort()
Called by the parser to notify the consumer that an "ABORT" message has been encountered (at any time...
Definition
HOAConsumerDAHeader.h:200
storm::automata::HOAConsumerDAHeader::ptr
std::shared_ptr< HOAConsumerDAHeader > ptr
Definition
HOAConsumerDAHeader.h:22
storm::automata::HOAConsumerDAHeader::notifyEnd
virtual void notifyEnd()
Called by the parser to notify the consumer that the automata definition has ended [mandatory,...
Definition
HOAConsumerDAHeader.h:194
storm::automata::HOAConsumerDAHeader::getHeader
HOAHeader & getHeader()
Definition
HOAConsumerDAHeader.h:26
storm::automata::HOAConsumerDAHeader::setTool
virtual void setTool(const std::string &, std::shared_ptr< std::string >)
Called by the parser for the "tool: ..." item [optional, once].
Definition
HOAConsumerDAHeader.h:113
storm::automata::HOAConsumerDAHeader::provideAcceptanceName
virtual void provideAcceptanceName(const std::string &name, const std::vector< cpphoafparser::IntOrString > &extraInfo)
Called by the parser for each "acc-name: ..." item [optional, multiple].
Definition
HOAConsumerDAHeader.h:83
storm::automata::HOAConsumerDAHeader::setNumberOfStates
virtual void setNumberOfStates(unsigned int numberOfStates)
Called by the parser for the "States: int(numberOfStates)" item [optional, once].
Definition
HOAConsumerDAHeader.h:40
storm::automata::HOAConsumerDAHeader::notifyWarning
virtual void notifyWarning(const std::string &warning)
Is called whenever a condition is encountered that merits a (non-fatal) warning.
Definition
HOAConsumerDAHeader.h:208
storm::automata::HOAHeader
Definition
HOAHeader.h:9
storm::automata::HOAHeader::accName
boost::optional< std::string > accName
Definition
HOAHeader.h:17
storm::automata::HOAHeader::numberOfAcceptanceSets
boost::optional< unsigned int > numberOfAcceptanceSets
Definition
HOAHeader.h:15
storm::automata::HOAHeader::numberOfStates
boost::optional< unsigned int > numberOfStates
Definition
HOAHeader.h:12
storm::automata::HOAHeader::acceptance_expression
cpphoafparser::HOAConsumer::acceptance_expr::ptr acceptance_expression
Definition
HOAHeader.h:16
storm::automata::HOAHeader::startState
boost::optional< unsigned int > startState
Definition
HOAHeader.h:11
storm::automata::HOAHeader::accNameExtraInfo
boost::optional< std::vector< cpphoafparser::IntOrString > > accNameExtraInfo
Definition
HOAHeader.h:18
storm::automata::HOAHeader::apSet
APSet apSet
Definition
HOAHeader.h:13
storm
LabParser.cpp.
Definition
cli.cpp:18
storm::automata::HOAConsumerDAHeader::header_parsing_done
Definition
HOAConsumerDAHeader.h:24
src
storm
automata
HOAConsumerDAHeader.h
Generated by
1.9.8