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

Re: Constructors motion 30 Version 2: small amendment



P1788

Generally I have had a fair amount of agreement with the revised Motion 30. I send it again with a small change suggested by Dan Zuras: the "virtual" constructors have "bare" inserted in their names and the others have "dec" removed from their names, since being decorated is the default.

Also shall num2interval(x) be abolished as Vincent suggests? Views please. It can be re-invented at a language level.

John Pryce

======
Motion
======================================================================
The standard shall specify constructors at Level 1 as described below.
======================================================================

-----------------------------
Specification of Constructors 
(Only approximating to actual text, since there is some "meta-description" in it.)
-----------------------------
An (interval) constructor by definition is an operation that creates a bare or decorated interval from non-interval data. The following Level 1 decorated interval constructors are defined, which shall have Level 2 versions as specified in <<suitable place in Clause 6>>. 

A NaI by definition is a decorated interval value that can never be the result of a successful construction, and is used to signal a construction failure. What NaI values exist will be decided by a later motion on decorations, but there must be at least one.

The decorated interval constructors are defined in terms of the following bare interval constructors, which are "virtual" since they have no Level 2 counterparts in the standard. 

- The constructor nums2bareinterval(l,u) is defined for a pair of extended-real 
 values (l, u). If the conditions l <= u , l < +oo and u > -oo hold, its 
 value is the nonempty interval [l,u] = {x in R | l <= x <= u}; otherwise it 
 is undefined.

- The constructor num2bareinterval(x) is equivalent to nums2bareinterval(x, x).

- The constructor text2bareinterval(t) is defined for text strings t. If t denotes 
 an interval according to some predefined syntax, its value is that interval; 
 otherwise it is undefined. 

[Note. Examples of suitable text strings t might be "[3.1,4.2]" or "[2\pi,
 \infty]” or "Entire". Since Level 1 is mainly for human-human communication, 
 the standard does not specify a syntax for t at Level 1. At Level 2, the 
 syntax for acceptable t is given in <<the subclause on I/O>>; this may 
 optionally be followed in a Level 1 algorithm.]

- The constructor bareempty() returns Empty. 

- The constructor bareentire() returns Entire. 

The decorated interval constructors nums2interval(l,u), num2interval(x), text2interval(t), empty(), entire() are defined as follows. If the value xx of the corresponding bare interval constructor is defined, then the decorated interval constructor is said to succeed, and returns (xx,d) where d is appropriate, in the decoration system, for a new interval with the value xx. Otherwise it fails, and returns a NaI as determined by the decoration system.

[Example. In a decoration system based on Arnold Neumaier's approach, (xx,d) equals domain(xx).]