Lex a decimal floating constant.
(lex-dec-fconst first-digit-after-dot first-pos-after-dot parstate) → (mv erp const last-pos new-parstate)
This is called when we expec a decimal floating constant, after we have read a dot followed by a decimal digit.
We read as many additional decimal digits as available. Then we read an exponent, if present. Then a floating suffix, if present. Finally, if check-full-ppnumber passes, we return an appropriate floating constant.
Function:
(defun lex-dec-fconst (first-digit-after-dot first-pos-after-dot parstate) (declare (xargs :stobjs (parstate))) (declare (xargs :guard (and (dec-digit-char-p first-digit-after-dot) (positionp first-pos-after-dot) (parstatep parstate)))) (let ((__function__ 'lex-dec-fconst)) (declare (ignorable __function__)) (b* (((reterr) (irr-const) (irr-position) parstate) ((erp decdigs decdigs-last-pos & parstate) (lex-*-digit first-pos-after-dot parstate)) ((erp expo? expo-last/next-pos parstate) (lex-dec-expo-if-present parstate)) ((erp fsuffix? suffix-last/next-pos parstate) (lex-fsuffix-if-present parstate)) ((erp parstate) (check-full-ppnumber nil parstate)) (core (if expo? (make-dec-core-fconst-frac :significand (make-dec-frac-const :before nil :after (cons first-digit-after-dot decdigs)) :expo? expo?) (make-dec-core-fconst-frac :significand (make-dec-frac-const :before nil :after (cons first-digit-after-dot decdigs)) :expo? nil)))) (retok (const-float (make-fconst-dec :core core :suffix? fsuffix?)) (cond (fsuffix? suffix-last/next-pos) (expo? expo-last/next-pos) (decdigs decdigs-last-pos) (t (position-fix first-pos-after-dot))) parstate))))
Theorem:
(defthm constp-of-lex-dec-fconst.const (b* (((mv acl2::?erp ?const ?last-pos ?new-parstate) (lex-dec-fconst first-digit-after-dot first-pos-after-dot parstate))) (constp const)) :rule-classes :rewrite)
Theorem:
(defthm positionp-of-lex-dec-fconst.last-pos (b* (((mv acl2::?erp ?const ?last-pos ?new-parstate) (lex-dec-fconst first-digit-after-dot first-pos-after-dot parstate))) (positionp last-pos)) :rule-classes :rewrite)
Theorem:
(defthm parstatep-of-lex-dec-fconst.new-parstate (implies (parstatep parstate) (b* (((mv acl2::?erp ?const ?last-pos ?new-parstate) (lex-dec-fconst first-digit-after-dot first-pos-after-dot parstate))) (parstatep new-parstate))) :rule-classes :rewrite)
Theorem:
(defthm parsize-of-lex-dec-fconst-uncond (b* (((mv acl2::?erp ?const ?last-pos ?new-parstate) (lex-dec-fconst first-digit-after-dot first-pos-after-dot parstate))) (<= (parsize new-parstate) (parsize parstate))) :rule-classes :linear)