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

Constructors and invalid combinations for decorated intervals



On 2015-03-24 11:16:20 +0000, John Pryce wrote:
> On 23 Mar 2015, at 18:22, Oliver Heimlich <oliver@xxxxxxxxxxxxxxxxxxx> wrote:
> > One thing that I am missing here: What shall the decorated
> > textToInterval do, if s is an invalid combination x_xd in the
> > flavor (e. g. [1, Inf]_com for set-based intervals)? Or should
> > this be implementation dependent?

I would expect that invalid combinations are handled in the same way
for all operations that can produce them. There's textToInterval. But
for the set-based flavor[*], there's also setDec, which specifies the
returned value (§11.5.2).

> Generally flavor-defined, not implementation-defined unless the flavor says so. I think this is covered by 7.5. "The relation of Level 1 to Level 2", in particular 7.5.3 which starts
> 
> "For each bare or decorated interval version of an arithmetic operation in 9.1 and for each operation in the rest of Clause 9, a T-version of φ shall be provided for each bare interval type T of the implementation..."
> 
> Actually at present it says "9.2 to 9.5" instead of "the rest of Clause 9", that is a typo caused by my putting subclauses of §9 in a different order, it used to say 9.2 to 9.8.
> 
> 7.5.3 says, if I recall right, that if there is no Level 1 value (which is the case for your invalid combination x_xd) then the flavor might require doing one or more of
> - signal UndefinedOperation or in some cases PossiblyUndefinedOperation
> - return a flavor-defined value that is considered "reasonable"
> Also if the Level 1 value exists but not the Level 2 value
> - signal IntvlOverflow.
> Or the flavor might leave it implementation-defined which of these to do.

It isn't clear that this rule applies. Constructing an invalid
combination is something specific that needs to be clarified.

> AFAICS, constructors should behave like other operations in this
> regard. Do you see problems with that?

Yes, but only constructors can produce an invalid combination. If the
decoration system is consistent, the other operations cannot produce
an invalid combination.

[*] Is there any reason that setDec is not required in all flavors?
Or has it been forgotten?

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)