A Practical Method of Developing Natural Language Rule Statements (Part 21)

Graham   Witt
Graham Witt Consultant / Author Read Author Bio || Read All Articles by Graham Witt
What is this series of articles about?

This is the twenty-first article in a series in which I describe a practical method of developing unambiguous natural language rule statements.  I've developed this method for a large Australian government agency that has selected the Business Rules Approach and the Object Management Group's Semantics of Business Vocabulary and Business Rules (SBVR)[1] as representative of best rules practice.

The story so far

We've been looking at some of the rules governing an online "Book Flights" facility provided by an airline.  So far we've created a set of rule statements, the fact types on which the rules are based, and some rule statement templates and sub-templates for generating rule statements.

We've also been developing a taxonomy of rules as well as a rule statement development method based on selection of the appropriate template and sub-template(s) for each type of rule.  The taxonomy, templates, and sub-templates are listed in the [sidebar] along with all valid rule statements and supporting fact types.

The font and colour conventions used in these articles reflect those in the SBVR.[2]  In addition, any technical terms (particularly those drawn from the field of linguistics) are rendered in a bold italic font.

Verb phrases in fact types and rule statements

The verb phrases that occur in fact types and rule statements can take many forms.  In the fact types and rule statements we have so far encountered, specifies, has, includes, boards, undergoes, enters, presents, bears, identifies, and serves are simple verbs (each consisting of one word), but the others are compound verbs:

  1. can access:  a modal verb, consisting of an auxiliary verb and another verb;

  2. is for, is of, connects with, and passes throughprepositional verbs, each consisting of a verb and a preposition;

  3. checks in for:  a combined phrasal/prepositional verb, consisting of a verb and two prepositions, the first acting as an adverb;

  4. gives rise to and is part of:  each of these consists of a verb, a noun, and a preposition;

  5. is a category of:  this consists of a verb, an article, a noun, and a preposition;

  6. is labelled with, is allocated to, is offered by, is available on, is operated by, and is booked on:  each of these consists of a verb, an adjective (or past participle), and a preposition.

Some fact types use the compound verb is specified in, but this is a passive form of the active verb specifies.  In fact, each binary fact type (a fact type involving two terms) has two forms, either of which may be used.  For example, FT116 (reproduced below) has the two forms shown (although only one form is shown in the sidebar).

FT116.  port serves city | city is served by port

This variety in verb forms is the reason I have been using <verb phrase> rather than <verb> as a placeholder in templates and sub-templates, in case readers might assume that only simple verbs could be used in those places.

Qualifying clauses revisited

In the previous article[3] I introduced a rule statement (RS160, reproduced below), which contains a qualifying clause (who checks that an aircraft door is disarmed[4]) that is not catered for by the current sub-templates for qualifying clauses.

RS160. The cabin crew member who checks that an aircraft door is disarmed must not be the same cabin crew member who disarmed that aircraft door.

It occurred to me that those sub-templates, while already complex enough, do not provide for the full variety of qualifying clauses.  To remedy that, we need first to review some of the qualifying clauses we've encountered so far, along with some others that we might encounter.  There are those that take the form of that (or who), followed by a verb phrase (such as weighs), a determiner (such as the, a, an, that, more than one), and a term, e.g.,

  1. that gives rise to that flight booking confirmation;

  2. that specifies more than one outgoing flight.

Often a qualifying clause is formed by dropping that is from the {that|who} <verb phrase> <determiner> <term>) form, e.g.,

  1. for a return journey is an abbreviated form of
    that is for a return journey;

  2. specified in each flight booking request is an abbreviated form of
    that is specified in each flight booking request;

  3. available on that flight is an abbreviated form of
    that is available on that flight.

The remainders of each verb phrase (for, specified in, and available on, respectively) are representative of the three types of verb part that appear frequently in qualifying clauses.

Each of these qualifying clauses is based on a binary fact type.  For example, for a return journey (which follows the term flight booking request) is based on fact type FT6:

FT6.  flight booking request is for return journey

A qualifying clause can instead be based on a unary fact type.  For example, that is international would be based on fact type FT67:

FT67.  flight is international

Still other qualifying clauses involve a comparison with a literal quantity, e.g.,

  1. that weighs more than 20kg;
  2. who is less than 2 years of age.

These are specific cases of predicates (range predicates to be precise) although a qualifying clause could use any type of predicate:

  1. a value set predicate, as in that is one of the cities served by the airline, or that is first class, business class or premium economy class;
  2. a match predicate, as in that is the same as the destination port;
  3. an equality predicate, as in that is equal to literal, that is equal to the fare paid, or that is equal to the number of passengers;
  4. even a uniqueness predicate, as in that is different to the fare that is paid by each other passenger.

Other qualifying clauses start with other than, e.g.,

  1. other than the last;
  2. other than a one-way journey.

And then there are qualifying clauses that involve a prepositional verb, e.g.,

  1. at which those flights connect;
  2. for which that passenger has checked in;
  3. to whom that passenger has presented his or her passport;
  4. in which the departure date is no earlier than the date of departure control.

However, the qualifying clause who checks that an aircraft door is disarmed does not fit any of the above forms.  A significant feature of verb phrases like checks that, states that, ask if, and question whether is that they assert or question the truth of a proposition (in this case an aircraft door is disarmed).  You may recall that a conditional clause can be used to make a rule statement dependent on the truth or falsehood of a proposition.  Thus, the additional form of qualifying clause is simply:

  1. that (or who) followed by
  2. a verb (such as checks, states, asks, or questions), followed by that, if, or whether, followed in turn by
  3. a conditional clause.

We have also encountered more complex qualifying clauses than the simple qualifying clauses above.  One way of forming a more complex qualifying clause is to join two or more qualifying clauses using and or or (as currently provided for by sub-templates ST40 – ST43), e.g.,

  1. that specifies that flight and specifies the departure date of that flight;
  2. that are both of the fare class specified in the flight booking confirmation and available on the outgoing flight specified in the flight booking confirmation.

Another way of forming a more complex qualifying clause is to append an additional qualifying clause to a qualifying clause that ends with a term, thus forming a chained qualifying clause, e.g.,

  1. of the outgoing flight specified in that flight booking confirmation;
  2. allocated by the postal authority of the country specified in that postal address.

Armed with these insights we can now assemble a new set of sub-templates for qualifying clauses to replace ST44, ST47, and ST48.

ST59. <verb part> ::=
  {<participle>|<adjective>|} <preposition>
ST60. <object> ::=
  {<determiner> <term> {<qualifying clause>|}|<literal>|<predicate>}
ST61. <qualifying clause> ::=
  {{that|who} <verb phrase 1> {<object 1>|}|
<
verb part> <object 2>
other than <determiner> {<term>|}|
<
preposition 2> {which|whom} <conditional clause 1>|
{
that|who} <verb phrase 2> {that|if|whether}<conditional clause 2>|
<and-qualifying clause>|
<or-qualifying clause>|
<both-and-qualifying clause>|
<either-or-qualifying clause>}

It should be clear that ST61 allows for nine variants:

  1. that or who, followed by a verb phrase, followed in turn by:
    1. a determiner and a term (possibly qualified), e.g., that specifies more than one outgoing flight,
    2. a literal, e.g., that flies to Australia,
    3. a predicate, e.g., that weighs more than 20kg or that is one of the cities served by the airline, or
    4. nothing, e.g., that is international;

  2. a determiner and a term (or a literal or a predicate) preceded by a verb part, i.e.:
    1. a participle and preposition, e.g., specified in each flight booking request,
    2. an adjective and preposition, e.g., available on that flight,
    3. a preposition, e.g., for a return journey;

  3. other than, followed by a determiner, followed in turn by:
    1. a term, e.g., other than a one-way journey,
    2. nothing, e.g., other than the last;

  4. a preposition and relative pronoun, followed by a determiner, a term, and a verb phrase, followed in turn by:
    1. another determiner and term, e.g., to whom that passenger has presented his or her passport,
    2. a predicate, e.g., in which the departure date is no earlier than the date of departure control,
    3. nothing, e.g., at which those flights connect;

  5. that or who, followed by a verb (such as checks, states, asks or questions), followed by that, if, or whether, followed in turn by a conditional clause, e.g., who checks that an aircraft door is disarmed;

  6. four variants allowing for qualifying clauses using and or or.

We also need new templates for those qualifying clauses using and or or, to replace ST40 – ST43 (inclusive).  Confining ourselves to and for the moment, we can see that there are three ways in which and can be used in a qualifying clause:

  1. separating different verb phrases with associated objects, as in RS110 (see [sidebar] for complete rule statement):
    that specifies the name of that passenger
    and bears a likeness of that passenger

  2. separating different objects of the same verb phrase, as in RS151:
    that specifies the name of that passenger
    and that flight
    and the departure date of that flight

  3. separating different verb parts and objects, for example:
    that is both specified in that flight booking request
    and available on that flight

Note that:

  1. Each form can be extended with as many ands as are required (as in the second example);

  2. Although each example above uses transitive verb phrases, intransitive verb phrases (without objects) are also allowed;

  3. both may be included in a qualifying clause using and, but only one and is then allowed.

The following sub-templates provide for all varieties of qualifying clauses using and:

ST62. <and-qualifying clause> ::=
  {{that|who} <verb phrase 1> {<object 1>|}|<and-qualifying clause>}
and {<verb phrase 2>|<verb part>|} {<object 2>|}
ST63. <both-and-qualifying clause> ::=
  {that|who}
{
both <verb phrase 1> {<object 1>|} and <verb phrase 2> {<object 2>|}|
{<
verb phrase 3> both {<object 3>|} and {<object 4>|}|
{
is|are}both {<verb part 1> {<object 5>|} and {<verb part 2> {<object 6>|}}

The following analogous sub-templates provide for all varieties of qualifying clauses using or:

ST64. <or-qualifying clause> ::=
  {{that|who} <verb phrase 1> {<object 1>|}|<or-qualifying clause>}
or {<verb phrase 2>|<verb part>|} {<object 2>|}
ST65. <either-or-qualifying clause> ::=
  {that|who}
{
either <verb phrase 1> {<object 1>|} or <verb phrase 2> {<object 2>|}|
{<
verb phrase 3> either {<object 3>|}or {<object 4>|}|
{
is|are}either {<verb part 1> {<object 5>|}or {<verb part 2> {<object 6>|}}

Definitional (structural) rules

So far we've only encountered a few types of definitional rule.  In the remainder of this article I'd like to discuss a few other varieties.  Before I do I would like to briefly discuss why I have chosen the "by definition" syntax in preference to those proposed in the SBVR.

Both the SBVR and RuleSpeak (which is described in an Annex to the SBVR) propose three types of definitional rule statement:

  1. A necessity statement expresses a necessity, i.e., something that is necessarily the case, e.g., that a person have a birth date.  The typical SBVR formulation starts with the clause "it is necessary that" (compared with "it is obligatory that" for an obligation statement expressing an operative rule), whereas a RuleSpeak necessity statement includes the word "always", e.g.,
    1. It is necessary that each person has a birth date.
    2. Each person always has a birth date.

  2. An impossibility statement expresses an impossibility, i.e., states that something is impossible, e.g., that a person be born in more than one country.  The typical SBVR formulation starts with the clause "it is impossible that" (compared with "it is prohibited that" for a prohibition statement expressing an operative rule), whereas a RuleSpeak impossibility statement includes the word "never", e.g.,
    1. It is impossible that the same person be born in more than one country.
    2. The same person is never born in more than one country.

  3. A restricted possibility statement expresses a situation that is possible only if a particular condition applies.  The typical SBVR formulation starts with the clause "it is possible that" (compared with "it is permitted that" for a restricted permission statement expressing an operative rule) followed eventually by the words "only if" immediately before the clause expressing the condition.  The RuleSpeak form of a restricted possibility statement includes "can" followed eventually by the words "only if" immediately before the clause expressing the condition.  For example,
    1. It is possible that a journey is a return journey only if the journey involves a return flight.
    2. A journey can be a return journey only if the journey involves a return flight.

Unfortunately I have found that these formulations lead to some practical difficulties:

  1. The difference between "necessary" and "obligatory" is rather too subtle for common use.  I have frequently encountered even well-educated business people use "necessary" when they mean "obligatory", e.g., "it is necessary for applications for leave to be submitted on the appropriate form."

  2. The use of "always" or "never" in a rule statement suggests that the rule stated is time-independent rather than time-dependent.  For example, the existence of a rule statement of the form "Each person always has a birth date." suggests that there may be attributes of a person that they have only for a certain period of time (as indeed there are, e.g., marriage date, retirement date).  Meanwhile the use of "never" in the rule statement "The same rental car is never owned by more than one branch." (included as an example in the SBVR) is ambiguous; what is meant is "The same rental car is never owned by more than one branch at the same time."

  3. It is not clear how RuleSpeak would use "always" to express the rule statement "It is necessary that each person was born in at most one country."

For these reasons, I have chosen to word definitional rule statements using "by definition" rather than the formulations proposed in the SBVR.

Definitional rules constrain how we define various constructs created by the organization (or the industry within which it operates).  These constructs include:

  1. formal definitions of terms (including role terms such as employee), e.g.,
RS81. An infant passenger is by definition a passenger who is less than 2 years of age at the time of travel.
RS162. An employee of an organization is by definition a person who is employed by that organization.
RS163. Christmas Day is by definition December 25th.
  1. enumerations of mutually-exclusive sets of categories or statuses, e.g.,
RS164. A flight is by definition either a domestic flight or an international flight.
RS116. A journey is by definition one of the following: a one-way journey, a return journey or a multi-stop journey.
  1. the structure of complex concepts, e.g.,
RS117. Each flight has by definition exactly one origin port.
  1. necessary relationships between components of complex concepts, e.g.,
RS83. The origin city of the return flight of a return journey is by definition the same as the destination city of the outgoing flight of that return journey.
RS84. The set of passengers booked on each flight specified in a flight booking confirmation is by definition the same as the set of passengers booked on each other flight specified in that flight booking confirmation.
  1. valid values of measurements and quantities, e.g.,
RS165. pH is by definition at least 0 and at most 14.
  1. algorithms for calculating values, e.g.,
RS166. The extension for an order line is by definition calculated as the product of:
the unit count for that order line
the unit price for that order line and
1 minus the discount rate for that order line.
  1. standard formats, e.g.,
RS132. A valid port code is by definition composed of exactly 3 letters.

We have already encountered RS81, RS83, RS84, RS116, RS117, and RS132; the others are new.  In the next article I shall discuss further the role of definitional rule statements as well as examine what templates and sub-templates we need for these rule statements.


To be continued...
In subsequent articles we will look at various other topics, including generating rule statements from a template and the role of the time dimension in rules.

References

[1]  Semantics of Business Vocabulary and Business Rules (SBVR), v1.0.  Object Management Group (Jan. 2008).  Available at http://www.omg.org/spec/SBVR/1.0/PDF  return to article

[2]  The font and colour conventions used in this and other well-formed rule statements and fact types in these articles reflect those in the SBVR, namely underlined teal for terms, italic blue for verb phrases, orange for keywords, and double-underlined green for names and other literals.   Note that, for clarity, less than well-formed rule statements will not use these conventions.  return to article

[3]  Graham Witt, "A Practical Method of Developing Natural Language Rule Statements (Part 20)," Business Rules Journal, Vol. 12, No. 4 (Apr. 2011), URL:  http://www.BRCommunity.com/a2011/b591.html  return to article

[4]  'Arming' of aircraft doors after closure but before takeoff ensures that, if a door is opened after a crash or emergency landing, an escape slide automatically inflates.  On landing, of course, all doors must be disarmed.  return to article

# # #

Standard citation for this article:


citations icon
Graham Witt , "A Practical Method of Developing Natural Language Rule Statements (Part 21) " Business Rules Journal Vol. 12, No. 6, (Jun. 2011)
URL: http://www.brcommunity.com/a2011/b603.html

About our Contributor:


Graham   Witt
Graham Witt Consultant / Author

Graham Witt has over 30 years of experience in assisting organisations to acquire relevant and effective IT solutions. NSW clients include the Department of Lands, Sydney Water, and WorkCover while Victorian clients include the Departments of Sustainability & Environment, Education & Early Childhood Development, and Human Services. Graham previously headed the information management and business rules practice in Ajilon's Sydney (Australia) office.

Graham has developed specialist expertise in business requirements, architectures, information management, user interface design, data modelling, relational database design, data quality, business rules, and the use of metadata repositories & CASE tools. He has also provided data modelling, database design, and business rules training to various clients including NAB, Telstra, British Columbia Government, and ASIC and in the form of public courses run by Simsion Bowles and Associates (Australia) and DebTech (USA).

He is the co-author, with Graeme Simsion, of the widely-used textbook "Data Modeling Essentials" and is the author of the newly published book, "Writing Effective Business Rules" (published by Elsevier). Graham has presented at conferences in Australia, the US, the UK, and France. Contact him at gwitt@pacific.net.au.

Read All Articles by Graham Witt
Subscribe to the eBRJ Newsletter
In The Spotlight
 Ronald G. Ross
 Jim  Sinur

Online Interactive Training Series

In response to a great many requests, Business Rule Solutions now offers at-a-distance learning options. No travel, no backlogs, no hassles. Same great instructors, but with schedules, content and pricing designed to meet the special needs of busy professionals.