• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
          • Preprocessor
          • Vl-loadconfig
          • Vl-loadstate
          • Lexer
          • Parser
            • Parse-expressions
            • Parse-udps
            • Parse-statements
            • Parse-property
            • Vl-genelements
            • Parse-paramdecls
            • Parse-blockitems
            • Parse-utils
              • Defparser
              • Vl-endinfo-p
              • Vl-match-token
              • Vl-match-some-token
              • Vl-match-any-except
              • Vl-parse-error
              • Vl-match
              • Vl-type-of-matched-token
              • Vl-tokstream-backup-p
              • Vl-maybe-match-token
              • Vl-parse-warning
              • Vl-match-any
                • Vl-linestart-indent
                • Vl-current-loc
                • Vl-choose-parse-error
                • Vl-parse-endblock-name
                • Vl-tokenlist-fix
                • Vl-lookahead-is-some-token?
                • Vl-tokstream-fix
                • Vl-is-token?
                • Vl-is-some-token?
                • Vl-add-context-to-parser-warning
                • Vl-lookahead-is-token?
                • Vl-tokstream-save
                • Vl-tokstream->tokens
                • Vl-tokstream-restore
                • Vl-tokstream-add-warning
                • Vl-tokstream->pstate
                • Vl-tokstream->position
                • Expand-defparsers
                • Vl-tokstream-pop
                • *vl-default-token*
              • Parse-insts
              • Parse-functions
              • Parse-assignments
              • Parse-clocking
              • Parse-strengths
              • Vl-parse-genvar-declaration
              • Vl-parse
              • Parse-netdecls
              • Parse-asserts
              • Vl-maybe-parse-lifetime
              • Parse-dpi-import-export
              • Parse-ports
              • Parse-timeunits
              • Seq
              • Parse-packages
              • Parse-eventctrl
            • Vl-load-merge-descriptions
            • Vl-find-basename/extension
            • Vl-load-file
            • Vl-loadresult
            • Scope-of-defines
            • Vl-find-file
            • Vl-flush-out-descriptions
            • Vl-description
            • Vl-read-file
            • Vl-includeskips-report-gather
            • Vl-load-main
            • Extended-characters
            • Vl-load
            • Vl-load-description
            • Vl-descriptions-left-to-load
            • Inject-warnings
            • Vl-preprocess-debug
            • Vl-write-preprocessor-debug-file
            • Vl-read-file-report-gather
            • Vl-load-descriptions
            • Vl-load-files
            • Translate-off
            • Vl-load-read-file-hook
            • Vl-read-file-report
            • Vl-loadstate-pad
            • Vl-load-summary
            • Vl-collect-modules-from-descriptions
            • Vl-loadstate->warnings
            • Vl-iskips-report
            • Vl-descriptionlist
          • Warnings
          • Getting-started
          • Utilities
          • Printer
          • Kit
          • Mlib
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Parse-utils

    Vl-match-any

    Compatible with seq. Get the first token, no matter what kind of token it is. Causes an error on EOF.

    Signature
    (vl-match-any &key (function '__function__) (tokstream 'tokstream)) 
      → 
    (mv errmsg? token new-tokstream)
    Arguments
    function — Guard (symbolp function).

    Definitions and Theorems

    Function: vl-match-any$inline

    (defun vl-match-any$inline (function tokstream)
      (declare (xargs :stobjs (tokstream)))
      (declare (xargs :guard (symbolp function)))
      (let ((__function__ 'vl-match-any))
        (declare (ignorable __function__))
        (b* ((tokens (vl-tokstream->tokens))
             ((when (atom tokens))
              (vl-parse-error "Unexpected EOF."
                              :function function))
             (tokstream (vl-tokstream-pop)))
          (mv nil (car tokens) tokstream))))

    Theorem: vl-match-any-fails-gracefully

    (defthm vl-match-any-fails-gracefully
      (implies (mv-nth 0 (vl-match-any))
               (equal (mv-nth 1 (vl-match-any)) nil)))

    Theorem: vl-warning-p-of-vl-match-any

    (defthm vl-warning-p-of-vl-match-any
      (iff (vl-warning-p (mv-nth 0 (vl-match-any)))
           (mv-nth 0 (vl-match-any))))

    Theorem: vl-token-p-of-vl-match-any

    (defthm vl-token-p-of-vl-match-any
      (implies (not (mv-nth 0 (vl-match-any)))
               (vl-token-p (mv-nth 1 (vl-match-any)))))

    Theorem: vl-match-any-fn-count-strong-on-value

    (defthm vl-match-any-fn-count-strong-on-value
     (and
      (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-match-any)))
          (vl-tokstream-measure))
      (implies
          (mv-nth 1 (vl-match-any))
          (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-match-any)))
             (vl-tokstream-measure))))
     :rule-classes ((:rewrite) (:linear)))

    Theorem: equal-of-vl-match-any-fn-count

    (defthm equal-of-vl-match-any-fn-count
     (equal
      (equal (vl-tokstream-measure :tokstream (mv-nth 2 (vl-match-any)))
             (vl-tokstream-measure))
      (if (mv-nth 0 (vl-match-any)) t nil)))