RVS: Examples of properties to check

Bruno Berstel
September 9, 2003

Rules from Baralis' paper

The rules

See baralis-rules.ilr.

The checks

The bad_account, raise_rate, SF_bonus, and decrease_bad rules have conditions on the rate attribute of an account, and/or modify this attribute. The following checks can be envisionned:

Extension

Suppose we add the following rule:

// Rule remove-empty-bad cleans the LOW-ACC relation by removing 0-day periods.

rule remove_empty_bad {
  when {
    low: LowAcc(start equals end);
  } then {
    remove low;
  }
}

Suppose also that the start_bad rule has a typo, and the first condition reads 'Account(n: num; balance <= 500)'. Then if an account has a balance of exactly 500, then the engine would loop, creating and removing 0-day periods.

The user may want a check against this kind of problems.

Car allocation (example from the training)

The rules

See car-allocation.ilr (the car-allocation.irl file contains the ruleset as exported from the Builder).

The checks

The ruleflow itself is purely linear. So there's nothing much to check on it.

A possible check could be a precondition of task basic_assignment stating that all cars in working memory are present.

A check for the whole ruleset can be that the reservation attribute of cars is not set more than once; and similarly, that the car attribute of reservations is not set more than once, except by rule exception.bumped_upgrade. This would require the user to explicit the semantics of the Reservation.isAssigned() and the Car.reserved() methods, with respect to the two attributes.

A postcondition of task free_upgrade could be to verify that frequent customers get better upgrades than non-frequent customers. One could propose to modify the free_upgrade.free_upgrade_loyalty_program rule's priority to be 'customer.nbRentals + 1'. The check could then be worded as: considering to reservations upgraded from the same requested group, the customer with the highest group has more rentals than the other.

I don't fully understand the exception.bumped_upgrade rule.