Subject: [Lager] Types for variants with context rules

From: Asmus Freytag <[email-masked]>
Date: Thu, 6 Aug 2015 20:53:51 -0700

There's an edge case that cropped up in the LGR draft for a particular 
script recently and I think it's worth adding a _recommended _way of 
writing an LGR in such cases.

As defined in the draft spec, a unique variant consists of a source, 
target, and a possibly empty context (when/not-when rule). An empty 
context is matched by all labels, while other contexts are matched by a 
subset of labels.

If I have a context c and a variant relation between source A and target B

A  a----> B when(c)
A  x----> B not-when(c)

I can assign one type to the first variant, and a different type to the 
second variant, for example allocatable for the first and blocked for 
the second (indicated by 'a' and 'x' at the arrows)

By using the same context rule 'c' with alternately a "when" and 
"not-when" attribute  these two mappings would cover all possible 
variant mappings from A --> B.

If the reverse B --> A is always allocatable or always blocked, it's 
tempting to write:

B x---> A

without context. Formally this would satisfy the symmetry requirement, 
but it would make it harder for tools to determine whether the LGR is in 
fact symmetric. Therefore, I think it should be at least RECOMMENDED to 
split the statement of reverse variant mappings so that they become

B x---> A when(c)
B x---> A not-when(c)

Stated more explicitly like this, a tool can more easily verify that the 
variant mappings are formally symmetric.

This is even more important if instead of

A  a----> B when(c)
A  x----> B not-when(c)

the mappings had been defined as

A  a----> B when(c)
A  x----> B when(c')

where c' is false for all labels for which c is true. In such a case, a 
tool would have to be able to prove that c' is the complement of c.

A typical case is where "c" is a context rule for some variant in final 
position for a label and where that variant is allocatable in one 
direction, but not the other, and never allocatable for any other 
position in the label. RECOMMENDING a fully symmetric statement of the 
mappings (or even disallowing the shortcut with an empty context for the 
reverse mapping) would allow better mechanical checks for symmetry.

A./

PS: for those of you wondering about the notation I'm using here, it's 
based on
https://community.icann.org/download/attachments/43989034/Variant Rules.pdf