Re: proposal to toss out text2interval. Was: dependent and independent intervals, proposal to toss out text2interval.
Am Thu, 28 Feb 2013 14:12:30 +0100
schrieb Vincent Lefevre <vincent@xxxxxxxxxx>:
> On 2013-02-27 22:22:41 +0100, Christian Keil wrote:
> > Am Tue, 19 Feb 2013 12:37:40 -0800
> > schrieb Richard Fateman <fateman@xxxxxxxxxxxxxxxxx>:
> >
> > > On 2/19/2013 2:00 AM, Guillaume Melquiond wrote:
> > > .... snip, , expressions meaning what they say...
> > >
> > > I think that whatever advantage can be gained by allowing an
> > > implementation to process string expressions like "0.1 + pi" is
> > > more
> > [...]
> >
> > probably I'm missing something here. But where does the idea to
> > allow "0.1 + pi" as an input to text2interval come from?
>
> AFAIK, the idea of text2interval was not to write expressions
> like "0.1 + pi", but rather text strings like "[0.1,0.2]" (or
> just "0.1"?). IMHO, some common forms should be standardized.
That is certainly one way to read it and the standard supports it in
11.11.1 with the notation suggested by the Vienna proposal:
"< 0.1 +- pi >". But even the pi here is already implementation-defined
and the context of Richard's comment is
> I think that whatever advantage can be gained by allowing an
> implementation to process string expressions like "0.1 + pi" is more
> than overcome by requiring
> the library of programs double_float_text2interval etc. to include a
> parser, evaluator of arbitrary-precision (or perhaps exact rational)
> arithmetic, an algebraic simplifier, and perhaps more. While some
> users might be happy with an interval standard that required
> Mathematica or Maple or similar programs
> to be available to the compiler, or perhaps even run-time system, it
> seems to me
> that this is not appropriate.
This certainly doesn't read like "this is a mid-rad-notation" but like
"this is an arbitrary expression that the compiler is supposed to
parse, simplify, and convert to an interval". Something which is way out
of scope here and nowhere intended.
> Then there's the question whether implementation-defined alternate
> forms should be allowed rather than specifying an error. I think
> that this can be useful (and somewhat necessary) to construct
> some intervals exactly, e.g. in case of a rational-based interval
> implementation (one may want to write "[1/17,1/3]").
This kind of enhanced syntax is explicitly facilitated by 11.11.1 as
being language- or implementation-defined. Therefore possible but not
specified by the standard.
> > There is also the mention of an language- or implementation-defined
> > enhanced syntax which may includes other symbols for real constants
> > like Pi in floating literals, but---besides this being language- or
> > implementation-defined---nothing is expressions.
>
> If what a symbol is isn't specified, you may see an expression
> as a symbol.
As it is language- or implementation-defined it's again not part of the
standard. If an implementation chooses to allow arbitrary expressions
as arguments to text2interval that's fine, but entirely in the
developers discretion.
Regards,
Christian