Concrete implementation of strin-find.
Function:
(defun sin$c-find (lit sin$c) (declare (xargs :stobjs (sin$c))) (declare (xargs :guard (and (stringp lit) (sin$c-okp sin$c)))) (let ((__function__ 'sin$c-find)) (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) len) (length str)) ((the (integer 0 *) litlen) (length lit)) (idx (str::strpos-fast lit str pos litlen len))) (and idx (the (unsigned-byte 60) (- idx pos))))))
Theorem:
(defthm sin-find{correspondence} (implies (and (sin$corr sin$c sin) (stringp lit) (strin-p sin)) (equal (sin$c-find lit sin$c) (strin-find lit sin))))