Match everything that remains, no matter what it is.
(sin-match-everything sin) → (mv match sin)
Examples:
(sin-match-everything [apple]) --> ("apple" []) (sin-match-everything []) --> (nil [])
Function:
(defun sin-match-everything (sin) (declare (xargs :stobjs (sin))) (declare (xargs :guard t)) (let ((__function__ 'sin-match-everything)) (declare (ignorable __function__)) (b* ((len (sin-len sin)) ((when (zp len)) (mv nil sin)) (match (sin-firstn len sin)) (sin (sin-nthcdr len sin))) (mv match sin))))
Theorem:
(defthm return-type-of-sin-match-everything.match (b* (((mv ?match ?sin) (sin-match-everything sin))) (or (stringp match) (not match))) :rule-classes :type-prescription)
Theorem:
(defthm str-match-everything.match-under-iff (b* (((mv ?match ?new-sin) (sin-match-everything sin))) (iff match (consp (strin-left sin)))))
Theorem:
(defthm stringp-of-sin-match-everything.match (b* (((mv ?match ?new-sin) (sin-match-everything sin))) (equal (stringp match) (consp (strin-left sin)))))
Theorem:
(defthm non-empty-of-sin-match-everything.match (b* (((mv ?match ?new-sin) (sin-match-everything sin))) (iff (consp (explode match)) (consp (strin-left sin)))))
Theorem:
(defthm sin-match-everything-progress (b* (((mv ?match new-sin) (sin-match-everything sin))) (equal (len (strin-left new-sin)) 0)))
Theorem:
(defthm sin-match-everything-reconstruction (b* (((mv match new-sin) (sin-match-everything sin))) (equal (append (explode match) (strin-left new-sin)) (strin-left sin))))