• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
          • Preprocessor
          • Vl-loadconfig
          • Lexer
            • Lex-strings
            • Lex-identifiers
            • Vl-typo-uppercase-p
            • Vl-typo-number-p
            • Vl-typo-lowercase-p
            • Lex-numbers
            • Chartypes
              • Vl-z-digit-p
              • Vl-x-digit-p
              • Vl-underscore-p
              • Vl-underscore-or-octal-digit-p
              • Vl-underscore-or-hex-digit-p
              • Vl-underscore-or-decimal-digit-p
              • Vl-underscore-or-binary-digit-p
              • Vl-simple-id-tail-p
              • Vl-simple-id-head-p
              • Vl-octal-digit-p
              • Vl-non-zero-decimal-digit-p
              • Vl-hex-digit-p
              • Vl-decimal-digit-p
              • Vl-binary-digit-p
              • Whitespace
                • Vl-printable-not-whitespace-p
                • Vl-whitespace-p
                  • Vl-printable-not-whitespace-list-p
                  • Vl-whitespace-list-p
                  • Whitespace-mask
                • Vl-underscore-or-octal-digit-list-p
                • Vl-underscore-or-hex-digit-list-p
                • Vl-underscore-or-decimal-digit-list-p
                • Vl-underscore-or-binary-digit-list-p
                • Vl-non-zero-decimal-digit-list-p
                • Vl-simple-id-tail-list-p
                • Vl-simple-id-head-list-p
                • Vl-decimal-digit-list-p
                • Vl-binary-digit-list-p
                • Vl-z-digit-list-p
                • Vl-x-digit-list-p
                • Vl-underscore-list-p
                • Vl-octal-digit-list-p
                • Vl-hex-digit-list-p
              • Vl-lex
              • Defchar
              • Tokens
              • Lex-keywords
              • Lexstate
              • Make-test-tokens
              • Lexer-utils
              • Lex-comments
              • Vl-typo-uppercase-list-p
              • Vl-typo-lowercase-list-p
              • Vl-typo-number-list-p
            • Vl-loadstate
            • Parser
            • Vl-load-merge-descriptions
            • Scope-of-defines
            • Vl-load-file
            • Vl-flush-out-descriptions
            • Vl-description
            • Vl-loadresult
            • Vl-read-file
            • Vl-find-basename/extension
            • Vl-find-file
            • Vl-read-files
            • Extended-characters
            • Vl-load
            • Vl-load-main
            • Vl-load-description
            • Vl-descriptions-left-to-load
            • Inject-warnings
            • Vl-load-descriptions
            • Vl-load-files
            • Vl-load-summary
            • Vl-collect-modules-from-descriptions
            • Vl-descriptionlist
          • Transforms
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Whitespace

    Vl-whitespace-p

    Definitions and Theorems

    Function: vl-whitespace-p$inline

    (defun vl-whitespace-p$inline (x)
      (declare (type character x))
      (and (mbt (characterp x))
           (mbe :logic (or (eql x #\Space)
                           (eql x #\Tab)
                           (eql x #\Page)
                           (eql x #\Newline)
                           (eql x (vertical-tab-char))
                           (eql x (carriage-return-char)))
                :exec (logbitp (char-code x)
                               (whitespace-mask)))))

    Function: vl-whitespace-echar-p$inline

    (defun vl-whitespace-echar-p$inline (x)
      (declare (xargs :guard (vl-echar-p x)))
      (vl-whitespace-p (vl-echar->char x)))

    Function: vl-whitespace-list-p

    (defun vl-whitespace-list-p (x)
      (declare (xargs :guard (character-listp x)))
      (let ((__function__ 'vl-whitespace-list-p))
        (declare (ignorable __function__))
        (if (consp x)
            (and (vl-whitespace-p (car x))
                 (vl-whitespace-list-p (cdr x)))
          t)))

    Theorem: vl-whitespace-list-p-of-cons

    (defthm vl-whitespace-list-p-of-cons
      (equal (vl-whitespace-list-p (cons acl2::a acl2::x))
             (and (vl-whitespace-p acl2::a)
                  (vl-whitespace-list-p acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-cdr-when-vl-whitespace-list-p

    (defthm vl-whitespace-list-p-of-cdr-when-vl-whitespace-list-p
      (implies (vl-whitespace-list-p (double-rewrite acl2::x))
               (vl-whitespace-list-p (cdr acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-when-not-consp

    (defthm vl-whitespace-list-p-when-not-consp
      (implies (not (consp acl2::x))
               (vl-whitespace-list-p acl2::x))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-p-of-car-when-vl-whitespace-list-p

    (defthm vl-whitespace-p-of-car-when-vl-whitespace-list-p
      (implies (vl-whitespace-list-p acl2::x)
               (iff (vl-whitespace-p (car acl2::x))
                    (or (consp acl2::x)
                        (vl-whitespace-p nil))))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-append

    (defthm vl-whitespace-list-p-of-append
      (equal (vl-whitespace-list-p (append acl2::a acl2::b))
             (and (vl-whitespace-list-p acl2::a)
                  (vl-whitespace-list-p acl2::b)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-list-fix

    (defthm vl-whitespace-list-p-of-list-fix
      (equal (vl-whitespace-list-p (list-fix acl2::x))
             (vl-whitespace-list-p acl2::x))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-sfix

    (defthm vl-whitespace-list-p-of-sfix
      (iff (vl-whitespace-list-p (sfix acl2::x))
           (or (vl-whitespace-list-p acl2::x)
               (not (setp acl2::x))))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-insert

    (defthm vl-whitespace-list-p-of-insert
      (iff (vl-whitespace-list-p (insert acl2::a acl2::x))
           (and (vl-whitespace-list-p (sfix acl2::x))
                (vl-whitespace-p acl2::a)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-delete

    (defthm vl-whitespace-list-p-of-delete
      (implies (vl-whitespace-list-p acl2::x)
               (vl-whitespace-list-p (delete acl2::k acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-mergesort

    (defthm vl-whitespace-list-p-of-mergesort
      (iff (vl-whitespace-list-p (mergesort acl2::x))
           (vl-whitespace-list-p (list-fix acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-union

    (defthm vl-whitespace-list-p-of-union
      (iff (vl-whitespace-list-p (union acl2::x acl2::y))
           (and (vl-whitespace-list-p (sfix acl2::x))
                (vl-whitespace-list-p (sfix acl2::y))))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-intersect-1

    (defthm vl-whitespace-list-p-of-intersect-1
      (implies (vl-whitespace-list-p acl2::x)
               (vl-whitespace-list-p (intersect acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-intersect-2

    (defthm vl-whitespace-list-p-of-intersect-2
      (implies (vl-whitespace-list-p acl2::y)
               (vl-whitespace-list-p (intersect acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-difference

    (defthm vl-whitespace-list-p-of-difference
      (implies (vl-whitespace-list-p acl2::x)
               (vl-whitespace-list-p (difference acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-duplicated-members

    (defthm vl-whitespace-list-p-of-duplicated-members
      (implies (vl-whitespace-list-p acl2::x)
               (vl-whitespace-list-p (duplicated-members acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-rev

    (defthm vl-whitespace-list-p-of-rev
      (equal (vl-whitespace-list-p (rev acl2::x))
             (vl-whitespace-list-p (list-fix acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-rcons

    (defthm vl-whitespace-list-p-of-rcons
      (iff (vl-whitespace-list-p (acl2::rcons acl2::a acl2::x))
           (and (vl-whitespace-p acl2::a)
                (vl-whitespace-list-p (list-fix acl2::x))))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-p-when-member-equal-of-vl-whitespace-list-p

    (defthm vl-whitespace-p-when-member-equal-of-vl-whitespace-list-p
      (and (implies (and (member-equal acl2::a acl2::x)
                         (vl-whitespace-list-p acl2::x))
                    (vl-whitespace-p acl2::a))
           (implies (and (vl-whitespace-list-p acl2::x)
                         (member-equal acl2::a acl2::x))
                    (vl-whitespace-p acl2::a)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-when-subsetp-equal

    (defthm vl-whitespace-list-p-when-subsetp-equal
      (and (implies (and (subsetp-equal acl2::x acl2::y)
                         (vl-whitespace-list-p acl2::y))
                    (vl-whitespace-list-p acl2::x))
           (implies (and (vl-whitespace-list-p acl2::y)
                         (subsetp-equal acl2::x acl2::y))
                    (vl-whitespace-list-p acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-set-equiv-congruence

    (defthm vl-whitespace-list-p-set-equiv-congruence
      (implies (set-equiv acl2::x acl2::y)
               (equal (vl-whitespace-list-p acl2::x)
                      (vl-whitespace-list-p acl2::y)))
      :rule-classes :congruence)

    Theorem: vl-whitespace-list-p-of-set-difference-equal

    (defthm vl-whitespace-list-p-of-set-difference-equal
     (implies
          (vl-whitespace-list-p acl2::x)
          (vl-whitespace-list-p (set-difference-equal acl2::x acl2::y)))
     :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-intersection-equal-1

    (defthm vl-whitespace-list-p-of-intersection-equal-1
      (implies
           (vl-whitespace-list-p (double-rewrite acl2::x))
           (vl-whitespace-list-p (intersection-equal acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-intersection-equal-2

    (defthm vl-whitespace-list-p-of-intersection-equal-2
      (implies
           (vl-whitespace-list-p (double-rewrite acl2::y))
           (vl-whitespace-list-p (intersection-equal acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-union-equal

    (defthm vl-whitespace-list-p-of-union-equal
      (equal (vl-whitespace-list-p (union-equal acl2::x acl2::y))
             (and (vl-whitespace-list-p (list-fix acl2::x))
                  (vl-whitespace-list-p (double-rewrite acl2::y))))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-take

    (defthm vl-whitespace-list-p-of-take
      (implies (vl-whitespace-list-p (double-rewrite acl2::x))
               (iff (vl-whitespace-list-p (take acl2::n acl2::x))
                    (or (vl-whitespace-p nil)
                        (<= (nfix acl2::n) (len acl2::x)))))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-repeat

    (defthm vl-whitespace-list-p-of-repeat
      (iff (vl-whitespace-list-p (repeat acl2::n acl2::x))
           (or (vl-whitespace-p acl2::x)
               (zp acl2::n)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-p-of-nth-when-vl-whitespace-list-p

    (defthm vl-whitespace-p-of-nth-when-vl-whitespace-list-p
      (implies (and (vl-whitespace-list-p acl2::x)
                    (< (nfix acl2::n) (len acl2::x)))
               (vl-whitespace-p (nth acl2::n acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-update-nth

    (defthm vl-whitespace-list-p-of-update-nth
     (implies
        (vl-whitespace-list-p (double-rewrite acl2::x))
        (iff (vl-whitespace-list-p (update-nth acl2::n acl2::y acl2::x))
             (and (vl-whitespace-p acl2::y)
                  (or (<= (nfix acl2::n) (len acl2::x))
                      (vl-whitespace-p nil)))))
     :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-butlast

    (defthm vl-whitespace-list-p-of-butlast
      (implies (vl-whitespace-list-p (double-rewrite acl2::x))
               (vl-whitespace-list-p (butlast acl2::x acl2::n)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-nthcdr

    (defthm vl-whitespace-list-p-of-nthcdr
      (implies (vl-whitespace-list-p (double-rewrite acl2::x))
               (vl-whitespace-list-p (nthcdr acl2::n acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-last

    (defthm vl-whitespace-list-p-of-last
      (implies (vl-whitespace-list-p (double-rewrite acl2::x))
               (vl-whitespace-list-p (last acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-remove

    (defthm vl-whitespace-list-p-of-remove
      (implies (vl-whitespace-list-p acl2::x)
               (vl-whitespace-list-p (remove acl2::a acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: vl-whitespace-list-p-of-revappend

    (defthm vl-whitespace-list-p-of-revappend
      (equal (vl-whitespace-list-p (revappend acl2::x acl2::y))
             (and (vl-whitespace-list-p (list-fix acl2::x))
                  (vl-whitespace-list-p acl2::y)))
      :rule-classes ((:rewrite)))

    Function: vl-read-while-whitespace-impl

    (defun vl-read-while-whitespace-impl (echars acc)
      (declare (xargs :guard (vl-echarlist-p echars)))
      (cond ((atom echars) (mv acc echars))
            ((vl-whitespace-p (vl-echar->char (car echars)))
             (vl-read-while-whitespace-impl (cdr echars)
                                            (cons (car echars) acc)))
            (t (mv acc echars))))

    Function: vl-read-while-whitespace$inline

    (defun vl-read-while-whitespace$inline (echars)
      (declare (xargs :guard (vl-echarlist-p echars)))
      (mbe :logic
           (cond ((atom echars) (mv nil echars))
                 ((vl-whitespace-p (vl-echar->char (car echars)))
                  (mv-let (prefix remainder)
                          (vl-read-while-whitespace (cdr echars))
                    (mv (cons (car echars) prefix)
                        remainder)))
                 (t (mv nil echars)))
           :exec
           (mv-let (prefix-rev remainder)
                   (vl-read-while-whitespace-impl echars nil)
             (mv (reverse prefix-rev) remainder))))

    Theorem: prefix-of-vl-read-while-whitespace

    (defthm prefix-of-vl-read-while-whitespace
     (and
      (true-listp (mv-nth 0 (vl-read-while-whitespace echars)))
      (implies
         (force (vl-echarlist-p echars))
         (vl-echarlist-p (mv-nth 0 (vl-read-while-whitespace echars)))))
     :rule-classes
     ((:rewrite)
      (:type-prescription
           :corollary
           (true-listp (mv-nth 0 (vl-read-while-whitespace echars))))))

    Theorem: remainder-of-vl-read-while-whitespace

    (defthm remainder-of-vl-read-while-whitespace
     (and
      (equal (true-listp (mv-nth 1 (vl-read-while-whitespace echars)))
             (true-listp echars))
      (implies
         (vl-echarlist-p echars)
         (vl-echarlist-p (mv-nth 1 (vl-read-while-whitespace echars)))))
     :rule-classes
     ((:rewrite)
      (:type-prescription
        :corollary
        (implies
             (true-listp echars)
             (true-listp (mv-nth 1
                                 (vl-read-while-whitespace echars)))))))

    Theorem: prefix-of-vl-read-while-whitespace-when-vl-whitespace-p

    (defthm prefix-of-vl-read-while-whitespace-when-vl-whitespace-p
      (implies (vl-whitespace-p (vl-echar->char (car echars)))
               (iff (mv-nth 0 (vl-read-while-whitespace echars))
                    (consp echars))))

    Theorem: vl-read-while-whitespace-sound

    (defthm vl-read-while-whitespace-sound
      (vl-whitespace-list-p
           (vl-echarlist->chars
                (mv-nth 0 (vl-read-while-whitespace echars)))))

    Theorem: vl-read-while-whitespace-complete

    (defthm vl-read-while-whitespace-complete
     (equal
          (vl-whitespace-p
               (vl-echar->char
                    (car (mv-nth 1 (vl-read-while-whitespace echars)))))
          (if (consp (mv-nth 1 (vl-read-while-whitespace echars)))
              nil
            (vl-whitespace-p (vl-echar->char nil)))))

    Theorem: append-of-vl-read-while-whitespace

    (defthm append-of-vl-read-while-whitespace
      (equal (append (mv-nth 0 (vl-read-while-whitespace echars))
                     (mv-nth 1 (vl-read-while-whitespace echars)))
             echars))

    Theorem: no-change-loser-of-vl-read-while-whitespace

    (defthm no-change-loser-of-vl-read-while-whitespace
      (implies (not (mv-nth 0 (vl-read-while-whitespace echars)))
               (equal (mv-nth 1 (vl-read-while-whitespace echars))
                      echars)))

    Theorem: acl2-count-of-vl-read-while-whitespace-weak

    (defthm acl2-count-of-vl-read-while-whitespace-weak
      (<= (acl2-count (mv-nth 1 (vl-read-while-whitespace echars)))
          (acl2-count echars))
      :rule-classes ((:rewrite) (:linear)))

    Theorem: acl2-count-of-vl-read-while-whitespace-strong

    (defthm acl2-count-of-vl-read-while-whitespace-strong
      (implies
           (mv-nth 0 (vl-read-while-whitespace echars))
           (< (acl2-count (mv-nth 1 (vl-read-while-whitespace echars)))
              (acl2-count echars)))
      :rule-classes ((:rewrite) (:linear)))