From 8fd0ee2ecd292a9c3159c3128e90f455ac18db57 Mon Sep 17 00:00:00 2001 From: sjunges Date: Mon, 7 Sep 2015 18:27:19 +0200 Subject: [PATCH] Formula to string added Former-commit-id: 53eb9bb5b43e50f3c385d09ed858a889678500b5 --- src/logic/Formula.cpp | 7 +++++++ src/logic/Formula.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/logic/Formula.cpp b/src/logic/Formula.cpp index 4037cb723..e621c1c78 100644 --- a/src/logic/Formula.cpp +++ b/src/logic/Formula.cpp @@ -1,4 +1,5 @@ #include "src/logic/Formulas.h" +#include namespace storm { namespace logic { @@ -404,6 +405,12 @@ namespace storm { return; } + std::string Formula::toString() const { + std::stringstream str2; + writeToStream(str2); + return str2.str(); + } + std::ostream& operator<<(std::ostream& out, Formula const& formula) { return formula.writeToStream(out); } diff --git a/src/logic/Formula.h b/src/logic/Formula.h index 3c3c3b5aa..4d831e456 100644 --- a/src/logic/Formula.h +++ b/src/logic/Formula.h @@ -174,6 +174,7 @@ namespace storm { std::shared_ptr asSharedPointer(); std::shared_ptr asSharedPointer() const; + std::string toString() const; virtual std::ostream& writeToStream(std::ostream& out) const = 0; virtual void gatherAtomicExpressionFormulas(std::vector>& atomicExpressionFormulas) const;