Interpret a string as a octal number.
For example,
Function:
(defun strval8 (x) (declare (xargs :guard (stringp x))) (declare (type string x)) (declare (xargs :split-types t)) (let ((acl2::__function__ 'strval8)) (declare (ignorable acl2::__function__)) (mbe :logic (let ((chars (explode x))) (and (consp chars) (oct-digit-char-list*p chars) (oct-digit-chars-value chars))) :exec (b* (((the unsigned-byte xl) (length x)) ((mv (the unsigned-byte val) (the unsigned-byte len)) (parse-octal-from-string x 0 0 0 xl))) (and (not (eql 0 len)) (eql len xl) val)))))
Theorem:
(defthm return-type-of-strval8 (b* ((value? (strval8 x))) (or (natp value?) (not value?))) :rule-classes :type-prescription)
Theorem:
(defthm istreqv-implies-equal-strval8-1 (implies (istreqv x x-equiv) (equal (strval8 x) (strval8 x-equiv))) :rule-classes (:congruence))