Skip past whitespace in a string.
(vl-skip-ws x n xl) → new-n
Function:
(defun vl-skip-ws (x n xl) (declare (xargs :guard (and (stringp x) (natp n) (eql xl (length x))))) (declare (xargs :guard (<= n xl))) (let ((__function__ 'vl-skip-ws)) (declare (ignorable __function__)) (b* ((n (lnfix n)) ((when (mbe :logic (zp (- (nfix xl) (nfix n))) :exec (eql n xl))) n) ((the character char) (char x n)) ((when (or (eql char #\Space) (eql char #\Newline) (eql char #\Tab) (eql char #\Page))) (vl-skip-ws x (+ 1 n) xl))) n)))
Theorem:
(defthm natp-of-vl-skip-ws (b* ((new-n (vl-skip-ws x n xl))) (natp new-n)) :rule-classes :type-prescription)
Theorem:
(defthm upper-bound-of-vl-skip-ws (implies (and (<= (nfix n) xl) (natp xl)) (<= (vl-skip-ws x n xl) xl)) :rule-classes ((:rewrite) (:linear)))
Theorem:
(defthm lower-bound-of-vl-skip-ws (implies (natp n) (<= n (vl-skip-ws x n xl))) :rule-classes ((:rewrite) (:linear)))
Theorem:
(defthm vl-skip-ws-of-str-fix-x (equal (vl-skip-ws (str-fix x) n xl) (vl-skip-ws x n xl)))
Theorem:
(defthm vl-skip-ws-streqv-congruence-on-x (implies (streqv x x-equiv) (equal (vl-skip-ws x n xl) (vl-skip-ws x-equiv n xl))) :rule-classes :congruence)
Theorem:
(defthm vl-skip-ws-of-nfix-n (equal (vl-skip-ws x (nfix n) xl) (vl-skip-ws x n xl)))
Theorem:
(defthm vl-skip-ws-nat-equiv-congruence-on-n (implies (acl2::nat-equiv n n-equiv) (equal (vl-skip-ws x n xl) (vl-skip-ws x n-equiv xl))) :rule-classes :congruence)