Currently, role value constraints apply only to single roles. Objectification can be a solution in some cases, but is not advisable in your example since there is no uniqueness constraint over the (A,B) role pair.
If you have a real world example where you wish to apply a value constraint matching the pattern you show, please provide it and we will consider whether to extend our value constraint support for such cases.
Cheers
Terry