From 7ae4d0806edde02093d4f90ee25d381b344180ff Mon Sep 17 00:00:00 2001 From: Sebastian Junges Date: Thu, 19 Dec 2019 13:07:20 +0100 Subject: [PATCH] expression conjucntion and disjunction --- examples/analysis/02-analysis.py | 4 ++-- src/storage/expressions.cpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/analysis/02-analysis.py b/examples/analysis/02-analysis.py index c744539..ecf9c7e 100644 --- a/examples/analysis/02-analysis.py +++ b/examples/analysis/02-analysis.py @@ -28,8 +28,8 @@ def example_analysis_02(): variables[v.name] = v.expression_variable.get_expression() expr_manager = prism_program.expression_manager - expr_for_state_1 = Expression.And(Expression.Eq(variables["s"],expr_manager.create_integer(1)), - Expression.Eq(variables["d"],expr_manager.create_integer(0))) + expr_for_state_1 = Expression.Conjunction([Expression.Eq(variables["s"],expr_manager.create_integer(1)), + Expression.Eq(variables["d"],expr_manager.create_integer(0))]) expr_for_state_2 = Expression.And(Expression.Eq(variables["s"],expr_manager.create_integer(4)), Expression.Eq(variables["d"],expr_manager.create_integer(0))) diff --git a/src/storage/expressions.cpp b/src/storage/expressions.cpp index d2c77b4..394aeca 100644 --- a/src/storage/expressions.cpp +++ b/src/storage/expressions.cpp @@ -1,3 +1,4 @@ +#include #include "expressions.h" #include "src/helpers.h" @@ -116,6 +117,9 @@ void define_expressions(py::module& m) { .def_static("Leq", [](Expression const& lhs, Expression const& rhs) {return lhs <= rhs;}) .def_static("Implies", [](Expression const& lhs, Expression const& rhs) {return storm::expressions::implies(lhs, rhs);}) .def_static("Iff", [](Expression const& lhs, Expression const& rhs) {return storm::expressions::iff(lhs, rhs);}) + .def_static("Conjunction", [](std::vector const& expr) {return storm::expressions::conjunction(expr); }) + .def_static("Disjunction", [](std::vector const& expr) {return storm::expressions::conjunction(expr); }) + ;