The meaning of the universal quantifier is that a condition enclosed by parentheses is evaluated (its truth value is determined) for all instances of an entity or collection. This is implemented as the ->forAll operator in the Operator Vocabulary. This operator will be demonstrated with an example created using the Vocabulary from the security ranking model. Note that these operators act on collections, so all the examples shown will declare aliases in the Scope section.

Figure 1. Rulesheet with universal quantifier (“for all”) condition

In this figure, you see the following condition:

secinfo ->forAll(secinfo.rank >= 3) 

The exact meaning of this condition is that for the collection of SecInfo elements associated with a Security (represented and abbreviated by the alias secInfo ), evaluate if the expression in parentheses (secinfo.rank >= 3) is true for all elements. The result of this condition is Boolean because it can only return a value of true or false. Depending on the outcome of the evaluation, a value of either High or Low will be assigned to the rating attribute of the Security entity, and the corresponding Rule Statement will be posted as a message to the user.

The following figure shows a Ruletest constructed to test the “for all” condition rules.

Figure 2. Ruletest for testing “for all” condition rules

In this Ruletest, a collection of three SecInfo elements associated with a Security entity is evaluated. Because the rank value assigned in each SecInfo object is at least 3, you should expect that the “for all” condition will evaluate to true, and a rating value of High will be assigned to the Security object when the Ruletest is run through the rules engine. This outcome is confirmed in the Ruletest results, as shown:

Figure 3. Ruletest for “for all” Condition Rules