When the regular expression matched the string, returns the substring that it matched
(matchresult->matched-substr x) → substr
Function:
(defun matchresult->matched-substr (x) (declare (xargs :guard (matchresult-p x))) (declare (xargs :guard (matchresult-in-bounds x))) (let ((__function__ 'matchresult->matched-substr)) (declare (ignorable __function__)) (b* (((matchresult x)) ((unless x.loc) nil)) (subseq x.str x.loc (+ x.loc x.len)))))
Theorem:
(defthm maybe-stringp-of-matchresult->matched-substr (b* ((substr (matchresult->matched-substr x))) (acl2::maybe-stringp substr)) :rule-classes :type-prescription)
Theorem:
(defthm matchresult->matched-substr-under-iff (b* ((?substr (matchresult->matched-substr x))) (iff substr (matchresult->matchedp x))))
Theorem:
(defthm matchresult->matched-substr-of-matchresult-fix-x (equal (matchresult->matched-substr (matchresult-fix x)) (matchresult->matched-substr x)))
Theorem:
(defthm matchresult->matched-substr-matchresult-equiv-congruence-on-x (implies (matchresult-equiv x x-equiv) (equal (matchresult->matched-substr x) (matchresult->matched-substr x-equiv))) :rule-classes :congruence)