Logic Rules

Logic rules are a rule type that enforces a relationship. Logic rules enable you to express constraints among elements of your model in terms of logical relationships. For example, selecting Option A may require that Options B and C be included in the configuration.

When defining a Logic Rule, you specify the rule's behavior by using the CONSTRAIN keyword with one of the following logic relations:

  • Requires

  • Negates

  • Implies

  • Excludes

The following sections describe each type of relation and present tables illustrating their behavior. In each table, the arrows point to the logic state the option has after an end user selects it.The arrows indicate the direction in which the rule propagates.

Notice that a rule can propagate from Operand A to Operand B of the relation, or from Operand B to Operand A. Notice also that for some values and some logic relations the rule doesn't propagate; therefore logic state of the option on the other side of the rule doesn't change.

Note: The terms "true" and "false" are used here to indicate only whether an option is included or excluded from the configuration.

Requires

Logic rules that use the Requires relation "push both ways," which means that selecting an option on one side of the rule has the same effect on the option on the other side of the rule. See the following examples for details. The following figure shows the effect of the Requires relation.

The effect of the Requires relation
  • If the end user selects an option on one side of the rule, the option on the other side of the rule is also selected. The same is true when the end user deselects an option. In other words, both options must be either included in the configuration, or excluded from the configuration.

Negates

The Negates relation is similar to the Requires relation, in that it also "pushes both ways." However, the Negates relation prevents an option from being selected when an option on the other side of the rule is selected. In other words, selecting one option prevents the other option from being included in the configuration. The following figure shows the effect of the Negates relation.

The effect of the Negates relation
  • If the end user selects Option A, it becomes true and Option B is set to false.

  • If the end user then deselects Option A, it becomes false and Option B becomes true. In other words, Option B is selected

  • If the end user selects Option B first, it becomes true and Option A becomes false.

  • If the end user then deselects Option B, Option A becomes true.

Implies

The following figure shows the effect of the Implies relation.

The effect of the Implies relation
  • If the end user selects Option A it becomes true and Option B is also selected. In other words, Option B's logic state becomes true.

  • Deselecting Option A causes Option A to become false and the state of Option B is unknown. In other words, Option B is available for selection.

  • If the end user selects Option B first, it becomes true and Option A is unknown.

  • If the end user deselects Option B, both Option B and A become false.

Excludes

The following figure shows the effect of the Excludes relation.

The effect of the Excludes relation
  • If the end user selects Option A, it becomes true and Option B becomes false. In other words, Option B is excluded from the configuration. If the end user tries to select Option B, Configurator displays a contradiction message.

  • If the end user deselects Option A, Option A becomes false and Option B becomes Unknown. In other words, Option B is available for selection.

  • If the end user selects Option B first, Option A becomes false.

  • If the end user deselects Option B, then Option A becomes Unknown.