Match any characters up until some literal.
(vl-read-until-literal string echars) → (mv successp prefix remainder)
Function:
(defun vl-read-until-literal$inline (string echars) (declare (xargs :guard (and (stringp string) (vl-echarlist-p echars)))) (declare (xargs :guard (not (equal string "")))) (let ((__function__ 'vl-read-until-literal)) (declare (ignorable __function__)) (mbe :logic (b* (((when (atom echars)) (mv nil nil echars)) ((when (vl-matches-string-p string echars)) (mv t nil echars)) ((mv successp prefix remainder) (vl-read-until-literal string (cdr echars)))) (mv successp (cons (car echars) prefix) remainder)) :exec (b* (((mv successp acc remainder) (vl-read-until-literal-impl string echars nil))) (mv successp (reverse acc) remainder)))))
Theorem:
(defthm vl-read-until-literal$inline-mvtypes-0 (booleanp (mv-nth 0 (vl-read-until-literal$inline string echars))) :rule-classes :type-prescription)
Theorem:
(defthm vl-read-until-literal$inline-mvtypes-1 (true-listp (mv-nth 1 (vl-read-until-literal$inline string echars))) :rule-classes :type-prescription)
Theorem:
(defthm vl-read-until-literal-impl-equiv (b* (((mv successp prefix remainder) (vl-read-until-literal string echars))) (equal (vl-read-until-literal-impl string echars acc) (list successp (revappend prefix acc) remainder))))
Theorem:
(defthm len-of-vl-read-until-literal (b* (((mv successp ?prefix remainder) (vl-read-until-literal string echars))) (implies successp (<= (len (explode string)) (len remainder)))) :rule-classes ((:rewrite) (:linear)))
Theorem:
(defthm vl-matches-string-p-after-vl-read-until-literal (b* (((mv successp ?prefix remainder) (vl-read-until-literal string echars))) (implies successp (vl-matches-string-p string remainder))))
Theorem:
(defthm consp-of-remainder-when-successful-vl-read-until-literal (b* (((mv successp ?prefix remainder) (vl-read-until-literal string echars))) (implies successp (consp remainder))))
Theorem:
(defthm true-listp-of-remainder-of-vl-read-until-literal (equal (true-listp (mv-nth 2 (vl-read-until-literal string echars))) (true-listp echars)))