diff --git a/prism/src/jltl2ba/APSet.java b/prism/src/jltl2ba/APSet.java index ac2bed9c..e96adaea 100644 --- a/prism/src/jltl2ba/APSet.java +++ b/prism/src/jltl2ba/APSet.java @@ -28,6 +28,7 @@ import java.io.PrintStream; /** * Class representing a set of atomic propositions (AP). + * The APs are ordered, in insertion order. */ public class APSet implements Iterable { @@ -119,16 +120,37 @@ public class APSet implements Iterable { canonical.addAP("p" + i); return canonical; } - + + /** Returns an iterator over the atomic propositions in this set */ public Iterator iterator() { return vector.iterator(); } - + + /** + * Returns an Iterator over the APElements induced by this AP set, + * i.e., all possible subsets for the AP set. + */ public Iterator elementIterator() { return new APElementIterator(vector.size()); } + + /** + * Returns an Iterable over the APElements induced by this AP set, + * i.e., all possible subsets for the AP set. + */ + public Iterable elements() + { + return new Iterable() { + @Override + public Iterator iterator() + { + return elementIterator(); + } + + }; + } public void print(PrintStream out) { for (int i = 0; i < size(); i++) {