From time to time, I feel the need to say something
about proof construction involved in ATS programming
Suppose we have got an array A of the type arrayref(T, N).
In other words, A is a persistent array of size N in which each
store element is of type T. Given an offset I and a natural number
J such that I+J <= N, it is obvious that there is a subarray
of size J located at A+I (where A refers to the starting location
of the array). How can we get out this subarray for use temporarily?
Yes, we could try to do it safely but that is not easy. It may
need years of training for someone to pick up this kind of skill.
Instead, let us do it by creating some proof out of thin air:
From time to time, I feel the need to say something
about proof construction involved in ATS programming
Suppose we have got an array A of the type arrayref(T, N).
In other words, A is a persistent array of size N in which each
store element is of type T. Given an offset I and a natural number
J such that I+J <= N, it is obvious that there is a subarray
of size J located at A+I (where A refers to the starting location
of the array). How can we get out this subarray for use temporarily?
Yes, we could try to do it safely but that is not easy. It may
need years of training for someone to pick up this kind of skill.
Instead, let us do it by creating some proof out of thin air: