diff --git a/prism/src/prism/DRA.java b/prism/src/prism/DRA.java index 90347fdf..92f4ea49 100644 --- a/prism/src/prism/DRA.java +++ b/prism/src/prism/DRA.java @@ -212,19 +212,22 @@ public class DRA /** * Is this Rabin automaton actually a finite automaton? This check is done syntactically: - * it returns true if L_i is empty for any acceptance pairs (L_i,K_i) - * and every transition from a K_i state goes to another K_i state. + * it returns true if every transition from a K_i state goes to another K_i state. + * We also require that there are no L_i states overlapping with any K_j states. */ public boolean isDFA() { - if (!isDBA()) - return false; // Compute union of all K_i sets BitSet acc = new BitSet(); int n = getNumAcceptancePairs(); for (int i = 0; i < n; i++) { acc.or(getAcceptanceK(i)); } + // Make sure there are no L_i states in any K_j states + for (int i = 0; i < n; i++) { + if (acc.intersects(getAcceptanceL(i))) + return false; + } // Check if every transition from a K_i state goes to another K_i state. for (int i = acc.nextSetBit(0); i >= 0; i = acc.nextSetBit(i + 1)) { int m = getNumEdges(i);