Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Decorations and Motion 22



John Pryce wrote:
What is the result of (bare decoration) op (bare interval)? E.g.
      ok + [1,2]
or
      [1,2] / ok

I disagree with Nate Hayes answer that ok + [1,2] = ok.
At the moment, we have quite different interpretations of how the
promotion should be done.

Indeed, Motion 8 and Motion 18 conflict in this respect.
We are in the process of sorting out what goes on. I don't understand
yet his reasoning (based on Motion 18), and he doesn't yet understand
mine (based on Motion 8).

So I can only tell you my view.


Then I suppose "ok" promotes to "an arbitrary ok decorated interval" (xx,ok).

No, only to nonempty xx, since (Empty,d0) is not  valid combination.
Moreover, after performing the operation, the least informative result
for all compatible xx is returned.


      ok + [1,2] = "possibly everywhere defined"
because that's the worst that can happen with (xx,ok) + ([1,2],2);

Yes. (But Nate Hayes gave the deviating answer "ok", an example of our disagreements.)


      [1,2] / ok = "nowhere defined"
because xx might be [0,0].

No. xx might be [1,2], hence ''nowhere defined'' is too strong a conclusion.


If it *is* forbidden, what is the result of the decorated interval constructor call
    XX = decoratedInterval(xx, dec)
when given interval xx = Empty and decoration dec = ok ?

The input is invalid, hence returns (Empty,invalid)




For further discussion, let me write down my precise assumptions:


Consider an interval datatype that has for an interval x the
floating-point data x.inf,x.sup, and optionally the integer x.dec
(which makes the interval decorated).

Let me write the presence of the decorations x.dec=0,...,4 as
d0:  safe = everywhere defined, continuous, and bounded)
d1:  everywhere defined
d2:  possibly everywhere defined
d3:  nowhere defined
d4:  not valid
The decorations are partially ordered according to information content
as d0>d1>d2<d3<d4. Thus d2 is the least informative decoration, where
nothing is claimed anymore; it is the bare decoration equivalent of
the bare interval Entire. d4 is sticky in all arithmetic operations.

It is assumed that the following property is invariant:
Exactly one of the following holds:
  (i) x.inf and x.sup satisfy x.inf<=x.sup; then x.dec<=2 if present.
 (ii) x.inf and x.sup are NaN; then x.dec>=3 if present.
In particular, this must be ensured to be the case for any operator
that returns a decorated interval; in particular for the constructor
of an interval from text (which always returns a decorated interval)
and for the constructor of a decorated interval from a bare interval
and a decoration. In particular,
   decorate(Empty,d)=(Empty,d4) unless d=d3,
   decorate(xx,d3)=(Empty,d4) unless xx=Empty,
   decorate(xx,d4)=(Empty,d4),

The result of any arithmetic operation involving only bare intervals is
a bare interval. The result of any arithmetic operation involving
one or more bare decoration is a bare decoration.

These results are determined according to the following promotion rules:
A nonempty bare interval is equivalent to the decorated interval with
decoration d2, while an empty bare interval is equivalent to the
decorated interval with decoration d3.
A bare decoration d in {d3,d4} to (Empty,d), and a bare decoration d
in {d0,d1,d2} is (conceptually) promoted to (xx,d) with any nonempty xx.
In the latter case, after performing the operation, the least
informative decoration for all compatible xx is returned.
This analysis is done conceptually and leads to an explicit operation
table for bare decorations.

The above promotion rule ensures that the least informative decoration
compatible with the input is returned. This (and only this) rule ensures
that the claim about the result of an operation involving a decorated
interval x is never stronger than the result of the same operation
involving bare(x). It is the decoration equivalent of ensuring the
containment property for ordinary interval arithmetic.

A bare decoration is promoted to an arbitrary compatible decorated
interval xx; after performing the operation, the least informative
result for all compatible xx is returned.

For example,
  d0+[1,2]=d0+d2=d2
  [1.2]/d0=d2/d0=d2.
  d4+[1,2]=d4+d2=d4.
  d0+Empty=d0+d3=d3
  d4+Empty=d4+d3=d4
Justification for [1.2]/d0=d2/d0=d2:
  After promoting d0 to (xx,d0) with nonempty xx, we get
  ([1,2],d2)/(xx,d0)=([1,2]/xx,d), where d=d3 if xx=[0,0],
  and d=d2 otherwise. The least informative result is therefore d2.


In a binary operation involving a bare decoration, it is safe to
convert bare intervals into bare decorations before the calculation
of the result. But in some cases, this might introduce unnecessary
pessimism. I haven't checked yet whether the loss of information
can be serious in some application. Probably it isn't; then we could
make this conversion a requirement in the standard.



Arnold Neumaier