empty intervals Per Bothner 29 Jul 2015 16:44 UTC Re: empty intervals John Cowan 29 Jul 2015 17:06 UTC Re: empty intervals John Cowan 29 Jul 2015 17:14 UTC Re: empty intervals Bradley Lucier 29 Jul 2015 20:21 UTC Re: empty intervals Per Bothner 29 Jul 2015 20:56 UTC Re: empty intervals Bradley Lucier 29 Jul 2015 22:01 UTC Re: empty intervals Per Bothner 29 Jul 2015 23:36 UTC Re: empty intervals John Cowan 01 Aug 2015 03:52 UTC Re: empty intervals Bradley Lucier 01 Aug 2015 03:57 UTC Re: empty intervals Bradley Lucier 31 Jul 2015 20:49 UTC Re: empty intervals Per Bothner 31 Jul 2015 22:14 UTC Re: empty intervals John Cowan 31 Jul 2015 23:57 UTC Re: empty intervals John Cowan 31 Jul 2015 23:37 UTC Re: empty intervals Bradley Lucier 01 Aug 2015 02:00 UTC Re: empty intervals John Cowan 29 Jul 2015 21:07 UTC Re: empty intervals Bradley Lucier 29 Jul 2015 22:26 UTC Re: empty intervals John Cowan 01 Aug 2015 04:20 UTC

Re: empty intervals Bradley Lucier 29 Jul 2015 20:21 UTC

> On Jul 29, 2015, at 12:44 PM, Per Bothner <xxxxxx@bothner.com> wrote:
>
>  "So the getter of an Array with an empty interval as a domain would be able to return
>  no values at all.  So I don't understand constructions that allow Arrays with empty
>  Intervals as domains to return a single value. Since I don't understand it, I don't allow it."
>
> "Empty intervals" can refer to two different things.  Consider: (l_0,...,l_d-1) and
> (u_0,...,U_d-1).  The number of elements in the array is:
>   (u_0 - l_u) ... * (u_d-1 - l_d_1).  So if any u_i = l_i then the number of elements is 0.
> This should be allowed.  One may view a vector as a 1-dimensional array (and in fact
> Kawa does that); clearly we allow 0-length vectors.
>
> The confusing issue of "Arrays with empty Intervals as domains to return a single value"
> refers to something slightly different: when the Interval-dimension (d - or 'rank' in APL-ese)
> is zero.  In that case note that the calculation of number of elements (above) returns 1 when d=0.
> Supporting this case is less useful, but I think for consistent and generality we should do so.

Thank you for the explanation.

Perhaps I should explain some of the other questions that arise in my mind when trying to think about empty intervals.

Is (interval ‘#(1) ‘#(0)) allowed?  It’s also empty (in the sense that no multi-indices satisfy 1<= i<0); is it equal to (interval ‘#(1) ‘#(1))?  Or (interval ‘#(2) ‘#(0))?  Or (interval '#(1 1) ‘#(0 0))?  Or is (interval ‘#(0) ‘#(0)) a subset of (interval ‘#(1) ‘#(2))?  (In set theory, the answer is yes.)

Is an empty set of one-indices "the same” (in whatever sense) as an empty set of two-indices?  (In set theory, yes.  In some other theories, I don’t know.)

I understand that the base case of no multiplicands gives one as an answer, because it’s useful.  (That’s the same reason that \$0^0=1\$, that it’s a useful convention.)

Perhaps if I understood the use of such things.  We already have scalars, why do we need zero-dimensional arrays?  Or arrays that can’t return any values, because their underlying domains are empty?