3#include "cpphoafparser/consumer/hoa_intermediate_check_validity.hh"
4#include "cpphoafparser/parser/hoa_parser.hh"
5#include "cpphoafparser/parser/hoa_parser_helper.hh"
16 : apSet(apSet), numberOfStates(numberOfStates), initialState(initialState), acceptance(acceptance) {
19 numberOfEdges = numberOfStates * edgesPerState;
20 successors.resize(numberOfEdges);
32 std::size_t index = from * edgesPerState + label;
33 return successors.at(index);
37 std::size_t index = from * edgesPerState + label;
38 successors.at(index) = successor;
42 return numberOfStates;
56 out <<
"States: " << numberOfStates <<
"\n";
58 out <<
"Start: " << initialState <<
"\n";
60 out <<
"AP: " << apSet.
size();
61 for (
unsigned int i = 0; i < apSet.
size(); i++) {
62 out <<
" " << cpphoafparser::HOAParserHelper::quote(apSet.
getAP(i));
66 out <<
"Acceptance: " << acceptance->getNumberOfAcceptanceSets() <<
" " << *acceptance->getAcceptanceExpression() <<
"\n";
68 out <<
"--BODY--" <<
"\n";
71 out <<
"State: " << s;
74 for (
unsigned int i = 0; i < acceptance->getNumberOfAcceptanceSets(); i++) {
75 if (acceptance->getAcceptanceSet(i).get(s)) {
91 cpphoafparser::HOAIntermediateCheckValidity::ptr validator(
new cpphoafparser::HOAIntermediateCheckValidity(consumer));
92 cpphoafparser::HOAParser::parse(in, validator);
94 return consumer->getDA();
103 STORM_LOG_INFO(
"Deterministic automaton from HOA file '" << filename <<
"' has " << da->getNumberOfStates() <<
" states, " << da->getAPSet().size()
104 <<
" atomic propositions and " << *da->getAcceptance()->getAcceptanceExpression()
105 <<
" as acceptance condition.");
std::size_t alphabetSize() const
const std::string & getAP(unsigned int index) const
unsigned int size() const
std::size_t alphabet_element
std::shared_ptr< AcceptanceCondition > ptr
static DeterministicAutomaton::ptr parseFromFile(const std::string &filename)
void setSuccessor(std::size_t from, APSet::alphabet_element label, std::size_t successor)
DeterministicAutomaton(APSet apSet, std::size_t numberOfStates, std::size_t initialState, std::shared_ptr< AcceptanceCondition > acceptance)
void printHOA(std::ostream &out) const
std::size_t getSuccessor(std::size_t from, APSet::alphabet_element label) const
std::size_t getInitialState() const
std::size_t getNumberOfEdgesPerState() const
const APSet & getAPSet() const
std::shared_ptr< DeterministicAutomaton > ptr
std::shared_ptr< AcceptanceCondition > getAcceptance() const
std::size_t getNumberOfStates() const
static DeterministicAutomaton::ptr parse(std::istream &in)
std::shared_ptr< HOAConsumerDA > ptr
#define STORM_LOG_INFO(message)
void closeFile(std::ofstream &stream)
Close the given file after writing.
void openFile(std::string const &filepath, std::ofstream &filestream, bool append=false, bool silent=false)
Open the given file for writing.