36#ifdef STORM_HAVE_SYLVAN
41 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
42 "version of Storm with Sylvan support.");
64#ifdef STORM_HAVE_SYLVAN
73 void execute(std::function<
void()>
const &f)
const {
74 internalManager.execute(f);
83 nameToIndex[name] = nextFreeVariableIndex;
84 indexToName[nextFreeVariableIndex] = name;
85 sylvan::Bdd::bddVar(nextFreeVariableIndex);
86 return nextFreeVariableIndex++;
94 sylvan::Bdd getPositiveLiteral(std::string
const name)
const {
95 return sylvan::Bdd::bddVar(nameToIndex.at(name));
105 sylvan::Bdd getNegativeLiteral(std::string
const name)
const {
106 return !sylvan::Bdd::bddVar(nameToIndex.at(name));
114 sylvan::Bdd getPositiveLiteral(uint32_t
const index)
const {
115 return sylvan::Bdd::bddVar(index);
125 sylvan::Bdd getNegativeLiteral(uint32_t
const index)
const {
126 return !sylvan::Bdd::bddVar(index);
133 sylvan::Bdd getOne() {
134 return sylvan::Bdd::bddOne();
141 sylvan::Bdd getZero() {
142 return sylvan::Bdd::bddZero();
149 uint32_t
getIndex(std::string
const name)
const {
150 return nameToIndex.at(name);
157 std::string
getName(uint32_t
const index)
const {
158 return indexToName.at(index);
170 void exportBddToDot(sylvan::Bdd
const &bdd, std::string
const &filename)
const {
171 FILE *filePointer = fopen(filename.c_str(),
"w+");
174 if (filePointer ==
nullptr) {
177 bdd.PrintDot(filePointer);
179 std::ofstream filestream;
181 filestream <<
"// Mapping from BDD nodes to DFT BEs as follows: \n";
182 for (
auto const &[index, name] : indexToName) {
183 filestream <<
"// " << index <<
" -> " << name <<
'\n';
189 void execute(std::function<
void()>
const &f)
const {
191 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
192 "version of Storm with Sylvan support.");
197 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
198 "version of Storm with Sylvan support.");
203 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
204 "version of Storm with Sylvan support.");
207 std::string
getName(uint32_t
const index)
const {
209 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
210 "version of Storm with Sylvan support.");
215#ifdef STORM_HAVE_SYLVAN
217 uint32_t nextFreeVariableIndex{0};
219 std::map<std::string, uint32_t> nameToIndex{};
220 std::map<uint32_t, std::string> indexToName{};
void openFile(std::string const &filepath, std::ofstream &filestream, bool append=false, bool silent=false)
Open the given file for writing.