FpML Issues Tracker

740: Phrase “if and only if” requires defining

June 6, 2008

closed

Minor

Always

Validation Rules

Admin

lyteck

Summary

The phrase "if and only if" is used frequently in the FpML Validation Rules. This phrase does not have its plain English definition, and consequently the phrase needs defining precisely. This is as per the VWG rules that terms must be defined.

Following the VWG's specification on how to define rules, this should be defined once as a function across all of the rules. The VWG specification is: " Function: iff Description: Return the logical "if and only if" of two xs:boolean operands. This is defined as (operand1 implies operand2) and (operand2 implies operand1). In simple terms either both are true or neither is true. Parameters: $p(xs:boolean), $q(xs:boolean) Result: xs:boolean "

In XQuery (for information only): declare function fun:iff($p as xs:boolean, $q as xs:boolean) as xs:boolean (: Return the logical "if and only if" :) { $p eq $q };

Notes:

  • matthewdr

    08/12/08 2:42 pm

    At the VWG Lyteck asked us to state what this would mean for an example query, such as ird-7. I volunteered to rewrite ird-7 as an example.

    The rule today as edited by Lyteck just recently. This has the problem that combining the clauses the order is undefined:

    ird-7 (Mandatory)
    Context: InterestRateStream (complex type)
    [isParametric]
    calculationPeriodAmount/calculation/compoundingMethod exists if and only if the frequencies in paymentDates/paymentFrequency and calculationPeriodDates/calculationPeriodFrequency are different. See also: frequency equivalence.

    The fixed version contains two functions:

    ird-7 (Mandatory)
    Context: InterestRateStream (complex type)
    [isParametric]
    iff(exist calculationPeriodAmount/calculation/compoundingMethod, different-frequencies(paymentDates/paymentFrequency, calculationPeriodDates/calculationPeriodFrequency))

  • lyteck

    08/22/08 8:18 pm

    – created a new shared function iff() in rules-function.xml
    – implemented ird-7 as proposed by Matthew but kept original English rule definition as comment
    (7 other instances of “if and only if”: ird-1, ird-23, ird-24, ird-49, shared-1, shared-9, shared-15)

  • matthewdr

    08/26/08 12:50 pm

    The term “frequency equivalence” needs to refer to the function “iff” instead of using the udnefined term “if and only if”.

    Also, the parameter cadinality must be stated for the function. From the FpML specification: “Each parameter has a minimum and maximum cardinality. This is given in the style of XML Schema. The cardinality must always be present.”

  • matthewdr

    08/26/08 12:57 pm

    The term “implies”, used in the function definition is undefined. The function should be defined in terms of the approved mathematical symbols as per the FpML specification.

    The form as per the VWG specification:

    Function Name: iff
    Description: Return the logical “if and only if” of two xs:boolean operands. This is defined as (operand1 implies operand2) and (operand2 implies operand1). In simple terms, either both are true or neither is true.
    Parameter 1: $p (xsd:boolean) min=1 max=1
    Parameter 2: $q (xsd:boolean) min=1 max=1
    Test: $p = $q

  • matthewdr

    08/26/08 2:01 pm

    Agreed at the VWG today –

    # Using no min/max is implicitly cardinality of 1. No change needed here.
    # Will change same-currency definition to use iff() function.
    # Will change test to “$p = $q”

  • lyteck

    08/26/08 2:26 pm

    # IRD “Frequency Equivalence” condition: “If the period multipliers of a pair of frequencies are equivalent, then they are equal if and only if the period elements are equal.”

    Changed to:

    iif(period elements are equal, If the period multipliers of a pair of frequencies are equivalent then they are equal)

    # iff(): changed test to $p = $q

  • matthewdr

    08/26/08 4:00 pm

    Resolved after testing.

  • Leave an update

    You must be logged in to post an update.