EsOCL

Constraints

  • context Membership inv: self.programs.partners->forAll(p | p.deliveredServices->forAll(d | d.pointsEarned = 0 ) ) implies self.account->isEmpty() = true
  • context LoyaltyAccount inv: self.points > 0 implies self.transactions->exists(t | t.points > 0 )
  • context Transaction inv: self.amount > 50 and self.points > 50
  • context CustomerCard inv: self.transactions->select(t | t.points > 100 ) ->notEmpty() = true