Clear an 1-dimensional array.
The function (RESET-ARRAY1 name l) returns a 1-dimensional array whose alist is simply the HEADER of l. This has the effect of resetting the array, i.e., reading the new array at any address will return the default value. The implementation is simply to redefine the array as the HEADER of the old array. Thus all of the HEADER information is carried over to the new array.
Note that an alternate definition is available as the lemma RESET-ARRAY1*.
Function:
(defun reset-array1 (name l) (declare (xargs :guard (array1p name l))) (compress1 name (list (header name l))))
Theorem:
(defthm array1p-reset-array1 (implies (array1p name l) (array1p name (reset-array1 name l))))
Theorem:
(defthm array1p-reset-array1-properties (implies (array1p name l) (and (equal (header name (reset-array1 name l)) (header name l)) (equal (dimensions name (reset-array1 name l)) (dimensions name l)) (equal (maximum-length name (reset-array1 name l)) (maximum-length name l)) (equal (default name (reset-array1 name l)) (default name l)))))
Theorem:
(defthm aref1-reset-array1 (implies (and (array1p name l) (integerp index)) (equal (aref1 name (reset-array1 name l) index) (default name l))))