2. Home Insurance Clause Example¶
See the L4 code for this ‘Home Insurance’ example, labelled as ‘Rodents and Vermin’
This example focus on a single decision rule drawn from a home insurance policy and its transformations to more easily understood forms.
“We do not cover any loss or damage caused by rodents, insects, vermin or birds. However, this exclusion does not apply to:
loss or damage to your contents caused by birds; or
ensuing covered loss unless any other exclusion applies or where an animal causes water to escape from a household appliance, swimming pool or plumbing, heating or air conditioning system.”
Following the method we learned in the “Must Sing” example, we need to:
Break the rule up into subclauses separated by keywords like EVERY, WHO, and AND.
Write down the nouns and verbs in the cell to the right of the keywords.
Remembering that we use indentation to disambiguate the sentence. An indentation is when the cells next to and below a keyword are blank.
Breaking the home insurance rule into subclauses¶
"We do not cover any loss or damage caused by rodents, insects, vermin or birds. However, this exclusion does not apply to:
loss or damage caused by birds; or
ensuing covered loss
unless any other exclusion applies
or where an animal causes water to escape from a household appliance, swimming pool or plumbing, heating or air conditioning system."
The two ways to encode the home insurance rule¶
We can write this rule in two ways, a ‘positive’ way and a ‘negative’ way.
The positive way is where we formalise the rule in a way that tells you that you are covered if the subclauses apply. Another way of saying this is “the damage is covered if…”
The negative way is where we formalise the rule in a way that tells you that you are not covered if the subclauses apply. Another way of saying this is “the damage is not covered if…”
Below is the table for the positive case, “the damage is covered if…” The rows and columns are numbered for convenience and reference.
Encoding of the positive version of the home insurance rule¶
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
|
1 |
DECIDE |
Loss or Damage 1 |
IS |
Covered |
|||||
2 |
IF |
NOT |
Loss or Damage |
caused by |
rodents |
||||
3 |
OR |
insects |
|||||||
4 |
OR |
vermin |
|||||||
5 |
OR |
birds |
|||||||
6 |
UNLESS |
Loss or Damage |
IS |
ensuing covered loss |
|||||
7 |
OR |
Loss or Damage |
IS |
to Contents |
|||||
8 |
AND |
Loss or Damage |
IS |
caused by birds |
|||||
9 |
UNLESS |
any other exclusion applies |
|||||||
10 |
OR |
any animal caused water to escape from |
a household appliance |
||||||
11 |
OR |
a swimming pool |
|||||||
12 |
OR |
a plumbing, heating, or air conditioning system |
Understanding the L4 encoding¶
This table looks very daunting, but we can split it into a few major subsections.
Step 1: Declare what version of the rule you’re encoding¶
The first step is to decide what version of the contract you’re encoding with the DECIDE keyword. In this case, we decided that we are encoding the positive vesion of the contract, “the damge is covered if…”
We see this decision in the first row, where we see “DECIDE Loss or damage 1 IS Covered”.
1 |
DECIDE |
Loss or Damage 1 |
IS |
Covered |
Step 2: Create the encoding one subclause at a time¶
First subclause¶
The original home insurance rule states that the rule is an exclusion that does not apply in certain cases, like damage caused by rodents, insects, vermin, or birds.
Since we’re encoding a positive version of this rule, we say “The damage is covered IF the damage is NOT caused by rodents, insects, vermin, or birds.”
We see this encoding from rows 2 to 5 of the encoding.
2 |
IF |
NOT |
Loss or Damage |
caused by |
rodents |
3 |
OR |
insects |
|||
4 |
OR |
vermin |
|||
5 |
OR |
birds |
Second subclause¶
The second subclause can be split into two subsubclauses.
6 |
UNLESS |
Loss or Damage |
IS |
ensuing covered loss |
|||
7 |
OR |
Loss or Damage |
IS |
to Contents |
|||
8 |
AND |
Loss or Damage |
IS |
caused by birds |
9 |
UNLESS |
any other exclusion applies |
||||||
10 |
OR |
any animal caused water to escape from |
a household appliance |
|||||
11 |
OR |
a swimming pool |
||||||
12 |
OR |
a plumbing, heating, or air conditioning system |