Write Rules In the Negative

Attributes in Policy Modeling rules may be expressed in either the positive form ("the person is happy") or negative form ("the person is not happy") in both conclusions and conditions. For example, you may write "the person is not happy" and this will be recognized as the negative form of "the person is happy".

When using both the positive and negative forms of an attribute within a policy model, take care that the attribute is only concluded once. Repeating a conclusion can result in two conflicting criteria for the conclusion to be satisfied. For example:

the person is considered an employee if

the person works set hours

and

the person is not considered an employee if

the person owns the equipment required to do the job

In this example, if a person works set hours and owns the equipment, is the person an employee or not? The logic is unclear. The logic must be grouped or prioritized to make that decision.

To avoid repeating the conclusion, an exclusion clause can be linked in to the conclusion rather than simply restating the same conclusion in the negative. For example:

the person is considered an employee if

the person works set hours and

the person does not own the equipment required to do the job

The negation function (Not()) can also be used to negate an attribute or other function (like Contains(), StartsWith(), ForAll(), IsMemberOf() and so on).

For example:

the email address is invalid if

Not(Contains(the email address, "@"))