11package crysl .rule ;
22
33import java .util .Collection ;
4- import java .util .LinkedList ;
54import java .util .Map ;
65
76public class CrySLRule {
@@ -18,6 +17,8 @@ public class CrySLRule {
1817
1918 private final Collection <ISLConstraint > constraints ;
2019
20+ private final Collection <ISLConstraint > requiredPredicates ;
21+
2122 private final Collection <CrySLPredicate > predicates ;
2223
2324 private final Collection <CrySLPredicate > negatedPredicates ;
@@ -29,6 +30,7 @@ public CrySLRule(
2930 Collection <CrySLMethod > events ,
3031 StateMachineGraph usagePattern ,
3132 Collection <ISLConstraint > constraints ,
33+ Collection <ISLConstraint > requiredPredicates ,
3234 Collection <CrySLPredicate > predicates ,
3335 Collection <CrySLPredicate > negatedPredicates ) {
3436 this .className = className ;
@@ -37,6 +39,7 @@ public CrySLRule(
3739 this .events = events ;
3840 this .usagePattern = usagePattern ;
3941 this .constraints = constraints ;
42+ this .requiredPredicates = requiredPredicates ;
4043 this .predicates = predicates ;
4144 this .negatedPredicates = negatedPredicates ;
4245 }
@@ -113,14 +116,8 @@ public Collection<CrySLPredicate> getNegatedPredicates() {
113116 /**
114117 * @return the constraints
115118 */
116- public Collection <CrySLPredicate > getRequiredPredicates () {
117- Collection <CrySLPredicate > requires = new LinkedList <>();
118- for (ISLConstraint con : constraints ) {
119- if (con instanceof CrySLPredicate ) {
120- requires .add ((CrySLPredicate ) con );
121- }
122- }
123- return requires ;
119+ public Collection <ISLConstraint > getRequiredPredicates () {
120+ return requiredPredicates ;
124121 }
125122
126123 @ Override
0 commit comments