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

Re: Motion 8 and sqrt




JWG> is that correct ?
JWG> and how do I propagate given decoration trits, if X is decorated ?
JWG> Is there an update operator for trits ?
JWG> one unique operator or several different?
JWG> user defined?


I think you need a way to access each part of an interval.  Think of it as a struct containing 2 fields - the undecorated interval and the decorations.  Also think of  the undecorated interval as a struct containing the lower bound and the upper bound, and the decorations as a struct with multiple bit fields, one per decoration.  Then you can read and write each part.  You likley also want functions to extract each part and to construct each struct (the whole, the undecorated interval, and the decorations) out of parts.

The way I'd suggest you propagate decorations for a unary operation like sqrt is to set the result decorations field to the input decorations, then change the individual decorations as needed.  For most operations the result cannot be defined unless the input was, so if the input deco:defined is -1 the result deco:defined needs to be too.  If the input deco:defined is 1 then the result deco:defined will be what you show.  If the input deco:defined is 0 (unknown) then I think the result deco:defined must also be unknown.

If the input is undefined or might be undefined, then you can't be sure that the result is bounded even if its value appears to be.  I think you can still be sure it's unbounded if one bound is -oo or +oo.

The last row includes the interval x1=0,x2=+oo, but the interval x1=-oo, x2=0 seems to be excluded from the ranges in the table.  I added the second row for it.

With those assumptions, one way to write the resulting definition is:

     X         |  sqrt(X)            | deco:defined                                      | deco:unbounded                       |
---------------------------------------------------------------------------------------------------------------------------------
x1 =-oo, x2<0 --> empty                -1                                                  1

 x1=-oo, x2=0 --> [0,0]                if x:deco:defined = -1 then x:deco:defined else 0   1
x1 < x2 < 0   --> empty                -1                                                  if x:deco:defined <= 0 then 0 else -1
x1< 0 < x2    --> [0,sqrt(x2)]         if x:deco:defined = -1 then x:deco:defined else 0   if x:deco:defined <= 0 then 0 else -1
x1 <0, x2=oo  --> [0,oo]               if x:deco:defined = -1 then x:deco:defined else 0   1
0<=x1 <=x2    --> [sqrt(x1),sqrt(x2)]  if x:deco:defined <= 0 then x:deco:defined else 1   if x:deco:defined <= 0 then 0 else -1
0<=x1,x2=oo   --> [sqrt(x1), oo]       if x:deco:defined <= 0 then x:deco:defined else 1   1


The 3 cases of "if x:deco:defined = -1 then x:deco:defined else 0" could be written as "if x:deco:defined = -1 then -1 else 0" but the way used is more consistent with the two cases of "if x:deco:defined <= 0 then x:deco:defined else 1".

Please check my assumptions and the resulting table.


- Ian McIntosh          Toronto IBM Lab   8200 Warden   D2-445



"J. Wolff v. Gudenberg" <wolff@xxxxxxxxxxxxxxxxxxxxxxxxxxx>

02/10/2009 08:07 AM
Please respond to
"J. Wolff v. Gudenberg" <wolff@xxxxxxxxxxxxxxxxxxxxxxxxxxx>

To
Ian McIntosh/Toronto/IBM@IBMCA
cc
Subject
Motion 8 and sqrt





Nate, Arnold, or anyone else
I try to implement the sqrt function with decorated intervals
then I have to care for the trits defined and unbounded

Given a bare interval X=[x1,x2]
define the decorated interval sqrt(X) as follows

    X          |  sqrt(X)      |deco:defined| deco:unbounded |
-----------------------------------------------------------
x1 =-oo, x2<0 --> empty              -1             1
x1 < x2 < 0   --> empty              -1             -1
x1< 0 < x2    --> [0,sqrt(x2)]        0             -1
x1 <0, x2=oo  --> [0,oo]              0             1
0<=x1 <=x2    --> [sqrt(x1),sqrt(x2)] 1             -1
0<=x1,x2=oo   --> [sqrt(x1), oo]      1             1

Here 1 means sure, 0 don't know, and -1 false
is that correct ?
and how do I propagate given decoration trits, if X is decorated ?
Is there an update operator for trits ?
one unique operator or several different?
user defined?

Juergen
--
=======
      o          Prof. Dr. J. Wolff v. Gudenberg,  Informatik 2
     / \         Univ. Wuerzburg,  Am Hubland,   D-97074 Wuerzburg
 info2 o        Tel.: +49 931 / 31-86602  Fax: +49 931 / 888-6603
   / \  Uni             e-mail: wolff@xxxxxxxxxxxxxxxxxxxxxxxxxxx
  o   o Wuerzburg         http://www2.informatik.uni-wuerzburg.de/