Concrete implementation of strin-nthcdr.
Function:
(defun sin$c-nthcdr (n sin$c) (declare (xargs :stobjs (sin$c))) (declare (xargs :guard (and (natp n) (sin$c-okp sin$c)))) (let ((__function__ 'sin$c-nthcdr)) (declare (ignorable __function__)) (b* (((the string str) (sin$c-str sin$c)) ((the (unsigned-byte 60) pos) (sin$c-pos sin$c)) ((the (unsigned-byte 60) line) (sin$c-line sin$c)) ((the (unsigned-byte 60) col) (sin$c-col sin$c)) ((the (unsigned-byte 60) len) (length str)) ((mv (the (unsigned-byte 60) new-pos) (the (unsigned-byte 60) new-line) (the (unsigned-byte 60) new-col)) (if (< (the (integer 0 *) n) (expt 2 60)) (lc-nthcdr-str-fast n str pos len line col) (ec-call (lc-nthcdr-str-fast n str pos len line col)))) (sin$c (update-sin$c-line new-line sin$c)) (sin$c (update-sin$c-col new-col sin$c))) (update-sin$c-pos new-pos sin$c))))
Theorem:
(defthm sin-nthcdr{correspondence} (implies (and (sin$corr sin$c sin) (natp n) (strin-p sin)) (sin$corr (sin$c-nthcdr n sin$c) (strin-nthcdr n sin))))