diff options
-rw-r--r-- | include/klee/Expr.h | 1 | ||||
-rw-r--r-- | lib/Expr/Expr.cpp | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/klee/Expr.h b/include/klee/Expr.h index 878a70ba..6d4df12e 100644 --- a/include/klee/Expr.h +++ b/include/klee/Expr.h @@ -222,6 +222,7 @@ public: static ref<Expr> createCoerceToPointerType(ref<Expr> e); static ref<Expr> createNot(ref<Expr> e); static ref<Expr> createImplies(ref<Expr> hyp, ref<Expr> conc); + static ref<Expr> createIff(ref<Expr> e1, ref<Expr> e2); static ref<Expr> createIsZero(ref<Expr> e); /// Create a little endian read of the given type at offset 0 of the diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp index 7b680567..695312ef 100644 --- a/lib/Expr/Expr.cpp +++ b/lib/Expr/Expr.cpp @@ -301,6 +301,11 @@ ref<Expr> Expr::createImplies(ref<Expr> hyp, ref<Expr> conc) { return OrExpr::create(Expr::createNot(hyp), conc); } +ref<Expr> Expr::createIff(ref<Expr> e1, ref<Expr> e2) { + return AndExpr::create(Expr::createImplies(e1, e2), + Expr::createImplies(e2, e1)); +} + ref<Expr> Expr::createIsZero(ref<Expr> e) { return EqExpr::create(e, ConstantExpr::create(0, e->getWidth())); } |