• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
              • Vl-ranges->dimensions
              • Vl-2005-parse-block-item-declaration-noatts
              • Vl-2012-parse-block-item-declaration-noatts
              • Vl-parse-main-data-declaration
              • Vl-parse-type-declaration
              • Vl-parse-fwd-typedef
              • Vl-parse-0+-block-item-declarations
                • Vl-parse-list-of-event-identifiers
                • Vl-parse-list-of-variable-identifiers
                • Vl-parse-realtime-declaration
                • Vl-parse-block-item-declaration-noatts
                • Vl-parse-time-declaration
                • Vl-parse-reg-declaration
                • Vl-parse-real-declaration
                • Vl-parse-integer-declaration
                • Vl-build-vardecls
                • Vl-parse-event-declaration
                • Vl-parse-block-item-declaration
                • Vl-parse-1+-let-ports
                • Vl-parse-variable-type
                • Vl-parse-let-declaration
                • Vl-parse-0+-let-ports
              • Parse-utils
              • 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-blockitems

    Vl-parse-0+-block-item-declarations

    Match as many block_item_declarations as we can find.

    Signature
    (vl-parse-0+-block-item-declarations &key (tokstream 'tokstream) 
                                         (config 'config)) 
     
      → 
    (mv errmsg? value new-tokstream)
    Arguments
    config — Guard (vl-loadconfig-p config).

    We use backtracking to know when to stop, because these declarations can be followed by arbitrary statements, hence it's not clear whether something like (* ... *) attributes are for the start of a new block item declaration or for a statement.

    Definitions and Theorems

    Function: vl-parse-0+-block-item-declarations-fn

    (defun vl-parse-0+-block-item-declarations-fn (tokstream config)
      (declare (xargs :stobjs (tokstream)))
      (declare (xargs :guard (vl-loadconfig-p config)))
      (declare (ignorable config))
      (let ((__function__ 'vl-parse-0+-block-item-declarations))
        (declare (ignorable __function__))
        (b* ((backup (vl-tokstream-save))
             ((mv erp first tokstream)
              (vl-parse-block-item-declaration))
             ((when erp)
              (b* ((tokstream (vl-tokstream-restore backup)))
                (mv nil nil tokstream))))
          (seq tokstream
               (rest := (vl-parse-0+-block-item-declarations))
               (return (append first rest))))))

    Theorem: vl-parse-0+-block-item-declarations-never-fails

    (defthm vl-parse-0+-block-item-declarations-never-fails
      (not (mv-nth 0
                   (vl-parse-0+-block-item-declarations))))

    Theorem: vl-parse-0+-block-item-declarations-result

    (defthm vl-parse-0+-block-item-declarations-result
      (implies (and (not (mv-nth 0
                                 (vl-parse-0+-block-item-declarations)))
                    (and t))
               (vl-blockitemlist-p
                    (mv-nth 1
                            (vl-parse-0+-block-item-declarations)))))

    Theorem: vl-parse-0+-block-item-declarations-true-listp

    (defthm vl-parse-0+-block-item-declarations-true-listp
      (true-listp (mv-nth 1
                          (vl-parse-0+-block-item-declarations)))
      :rule-classes :type-prescription)

    Theorem: vl-parse-0+-block-item-declarations-count-strong-on-value

    (defthm vl-parse-0+-block-item-declarations-count-strong-on-value
     (and
      (<=
         (vl-tokstream-measure
              :tokstream (mv-nth 2
                                 (vl-parse-0+-block-item-declarations)))
         (vl-tokstream-measure))
      (implies
       (mv-nth 1 (vl-parse-0+-block-item-declarations))
       (<
         (vl-tokstream-measure
              :tokstream (mv-nth 2
                                 (vl-parse-0+-block-item-declarations)))
         (vl-tokstream-measure))))
     :rule-classes ((:rewrite) (:linear)))