The following rules are some of the "shared component" rules necessary to validate FpML trades. FpML is a standard for transferring "over the counter" (OTC) derivatives trades in XML, and is a trademark of the International Swaps and Derivatives Association.
These rules are published here as an example of how the NRL can make rules for a model with reasonable attribute names quite readable.
Model "FpML.uml2"
Context:
BusinessDayAdjustments
Rule "shared-1"
businessCentersReference is present or
businessCenters are present only
if businessDayConvention <>
BusinessDayConventionEnum.NONE
and
businessDayConvention <>
BusinessDayConventionEnum.NotApplicable
Context: RelativeDateOffset
Rule "shared-4"
If dayType =
DayTypeEnum.Business then
businessDayConvention =
BusinessDayConventionEnum.NONE
Context: AmericanExercise
Rule "shared-6"
If latestExerciseTime is present then
earliestExerciseTime.hourMinuteTime is
before latestExerciseTime.hourMinuteTime
Context: BermudaExercise
Rule "shared-7"
If latestExerciseTime is present then
earliestExerciseTime.hourMinuteTime is
before latestExerciseTime.hourMinuteTime
Context: DateRange
Rule "shared-8"
unadjustedFirstDate is before
unadjustedLastDate
Context: BusinessDateRange
Rule "shared-9"
businessCentersReference is present or businessCenters are present only
if businessDayConvention <>
BusinessDayConventionEnum.NONE
and businessDayConvention
<>
BusinessDayConventionEnum.NotApplicable
Context: Offset
Rule "shared-15"
dayType is present only if
period = PeriodEnum.D and
periodMultiplier
is not equal to 0
Context: Interval
Rule "test"
periodMultiplier is not equal to
0
Back to http://nrl.sourceforge.net.