Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DDEncodingExporter.cpp
Go to the documentation of this file.
2
3#include "storm/io/file.h"
5
6namespace storm {
7namespace io {
8
9template<storm::dd::DdType Type, typename ValueType>
10void explicitExportSymbolicModel(std::string const& filename, std::shared_ptr<storm::models::symbolic::Model<Type, ValueType>> symbolicModel) {
11 std::ofstream filestream;
12 storm::io::openFile(filename, filestream);
13 filestream << "// storm exported dd\n";
14 filestream << "%transitions\n";
15 storm::io::closeFile(filestream);
16 symbolicModel->getTransitionMatrix().exportToText(filename);
17 storm::io::openFile(filename, filestream, true, true);
18 filestream << "%initial\n";
19 storm::io::closeFile(filestream);
20 symbolicModel->getInitialStates().template toAdd<ValueType>().exportToText(filename);
21 for (auto const& label : symbolicModel->getLabels()) {
22 storm::io::openFile(filename, filestream, true, true);
23 filestream << "\n%label " << label << '\n';
24 storm::io::closeFile(filestream);
25 symbolicModel->getStates(label).template toAdd<ValueType>().exportToText(filename);
26 }
27}
28
30 std::string const&, std::shared_ptr<storm::models::symbolic::Model<storm::dd::DdType::CUDD, double>> sparseModel);
32 std::string const&, std::shared_ptr<storm::models::symbolic::Model<storm::dd::DdType::Sylvan, double>> sparseModel);
33
35 std::string const&, std::shared_ptr<storm::models::symbolic::Model<storm::dd::DdType::Sylvan, storm::RationalNumber>> sparseModel);
37 std::string const&, std::shared_ptr<storm::models::symbolic::Model<storm::dd::DdType::Sylvan, storm::RationalFunction>> sparseModel);
38} // namespace io
39} // namespace storm
Base class for all symbolic models.
Definition Model.h:46
template void explicitExportSymbolicModel< storm::dd::DdType::CUDD, double >(std::string const &, std::shared_ptr< storm::models::symbolic::Model< storm::dd::DdType::CUDD, double > > sparseModel)
template void explicitExportSymbolicModel< storm::dd::DdType::Sylvan, storm::RationalFunction >(std::string const &, std::shared_ptr< storm::models::symbolic::Model< storm::dd::DdType::Sylvan, storm::RationalFunction > > sparseModel)
template void explicitExportSymbolicModel< storm::dd::DdType::Sylvan, storm::RationalNumber >(std::string const &, std::shared_ptr< storm::models::symbolic::Model< storm::dd::DdType::Sylvan, storm::RationalNumber > > sparseModel)
void explicitExportSymbolicModel(std::string const &filename, std::shared_ptr< storm::models::symbolic::Model< Type, ValueType > > symbolicModel)
Exports a sparse model into the explicit drdd format.
void closeFile(std::ofstream &stream)
Close the given file after writing.
Definition file.h:47
void openFile(std::string const &filepath, std::ofstream &filestream, bool append=false, bool silent=false)
Open the given file for writing.
Definition file.h:18
template void explicitExportSymbolicModel< storm::dd::DdType::Sylvan, double >(std::string const &, std::shared_ptr< storm::models::symbolic::Model< storm::dd::DdType::Sylvan, double > > sparseModel)
LabParser.cpp.
Definition cli.cpp:18