From 30ed75086fe534bc73ce2b6138c66bcd6f60ba6c Mon Sep 17 00:00:00 2001 From: Joachim Klein Date: Thu, 15 Sep 2016 05:51:20 +0000 Subject: [PATCH] AcceptanceGeneric: add and() and or() methods git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11826 bbc10eb1-c90d-0410-af57-cb519fbb1720 --- prism/src/acceptance/AcceptanceGeneric.java | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/prism/src/acceptance/AcceptanceGeneric.java b/prism/src/acceptance/AcceptanceGeneric.java index 5aa8a7d6..2ac902ea 100644 --- a/prism/src/acceptance/AcceptanceGeneric.java +++ b/prism/src/acceptance/AcceptanceGeneric.java @@ -255,6 +255,30 @@ public class AcceptanceGeneric implements AcceptanceOmega { throw new UnsupportedOperationException("Unsupported operator in generic acceptance condition"); } + /** + * Returns a new generic acceptance condition that corresponds to the conjunction + * of this and the other acceptance condition. Both conditions are not + * cloned; take care not to modify the conditions or clone beforehand. + * @param other the other generic acceptance condition + * @return new AcceptanceRabin, conjunction of this and other + */ + public AcceptanceGeneric and(AcceptanceGeneric other) + { + return new AcceptanceGeneric(ElementType.AND, this, other); + } + + /** + * Returns a new generic acceptance condition that corresponds to the disjunction + * of this and the other acceptance condition. Both conditions are not + * cloned; take care not to modify the conditions or clone beforehand. + * @param other the other generic acceptance condition + * @return new AcceptanceGeneric, disjunction of this and other + */ + public AcceptanceGeneric or(AcceptanceGeneric other) + { + return new AcceptanceGeneric(ElementType.OR, this, other); + } + /** Complement this acceptance condition, return as AcceptanceGeneric. */ public AcceptanceGeneric complementToGeneric() {