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

Re: about emp (was: Motion 42: NO)



Le lundi 11 février 2013 à 03:07 +0100, Vincent Lefevre a écrit :
> > > > > nonempty_emp makes sense for sqrt(-x*x-1) with x = [-1,1]. As an
> > > > > expression on intervals, sqrt(-x*x-1) = sqrt(-[-1,1]-1) = sqrt([-2,0])
> > > > > = [0,0], so that the computed result must contain [0,0]. In general,
> > > > > one would get [0,0]_trv. But if the implementation can determine that
> > > > > for the point function sqrt(-x*x-1), the result is not defined for any
> > > > > input of [-1,1], then it could improve the decoration to emp.
> > > > 
> > > > You are telling me that the implementation knows that the point function
> > > > being computed is not defined, but it still bothers to return a nonempty
> > > > interval for the interval function? That is just crazy.
> > > > 
> > > > Either the implementation knows that the point function being computed
> > > > is not defined and it returns empty_emp or empty_ill, or it does not and
> > > > it returns [0,0]_trv or any superset. Any other behavior is meaningless.
> > > 
> > > No, you didn't understand. The functions are used for different purpose
> > > by the user: approximation of point functions, range of a point function
> > > over an interval, range computations, etc. P1788 provides only one kind
> > > of functions for all these. There are flavors to differentiate some uses
> > > but even in the set-based flavor, there are different uses. And the
> > > implementation cannot know what is the intent of the user. For range
> > > computations (where variables represent no more than intervals), the
> > > implementation MUST return an interval that contains [0,0], as said
> > > above. So, returning Empty (with any decoration) would be wrong.
> > 
> > As you say, the implementation cannot know what is the intent of the
> > user. So how does the implementation dare put the emp decoration on the
> > result [0,0] after executing the following sequences of operations?
> > 
> > x <- newDec([-1,1])
> > a <- x * x
> > b <- newDec([1,1])
> > c <- - a
> > d <- c - b
> > e <- sqrt(d)
> 
> Because when considering decorations (and only in this case), reasoning
> is based on the *point functions*, not their interval version. The point
> function is here f(x) = sqrt(-x*x-1).

You do not know that! Who said that the point function was f(x) =
sqrt(-x*x-1)? Is there anything in the motion that prevents the point
function from being f(x,y) = sqrt(-x*y-1)? In that case, the domain is
definitely not empty.

Do not forget about this fundamental principle of modern programming
languages, "referential transparency", which basically states that, if
the call to a function has no side effect, then it can be replaced by
its result. (This is the idea behind numerous compiler optimizations:
constant propagation, common subexpression elimination, and so on.)

In other words, since the call to newDec has no side effects, there
should be absolutely no observable differences between

        x <- newDec([-1,1])
        y <- newDec([-1,1])
        a <- x * y
        ...

and the code above. In particular, the final decoration should be the
same. Just because the user wrote twice the interval x in the code is
not reason enough to suppose that the interval designates an enclosure
of the same real value.

Best regards,

Guillaume