• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
          • Preprocessor
            • Vl-iframe-p
            • Preprocessor-ifdef-minutia
            • Vl-preprocess-loop
            • Vl-read-until-end-of-define
            • Vl-expand-define
              • Vl-parse-define-actual
              • Vl-parse-define-actuals
              • Vl-read-include
              • Vl-process-ifdef
              • Vl-substitute-into-macro-text
              • Vl-preprocess
              • Vl-define
              • Vl-process-define
              • Vl-process-undef
              • Preprocessor-include-minutia
              • Vl-split-define-text
              • Vl-read-timescale
              • Vl-line-up-define-formals-and-actuals
              • Vl-process-else
              • Vl-process-endif
              • Vl-istack-p
              • Vl-is-compiler-directive-p
              • Vl-check-remaining-formals-all-have-defaults
              • Vl-safe-previous-n
              • Vl-safe-next-n
              • Vl-defines
              • *vl-preprocess-clock*
            • Vl-loadconfig
            • Lexer
            • 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
    • Vl-expand-define

    Vl-parse-define-actuals

    Collect the arguments to a macro, like `max(a+b, c).

    Signature
    (vl-parse-define-actuals name echars config loc) 
      → 
    (mv successp actuals remainder)
    Arguments
    name — Name of macro being expanded, e.g., max, for error messages.
        Guard (stringp name).
    echars — Text that follows the initial open paren, or that follows a comma.
        Guard (vl-echarlist-p echars).
    config — Guard (vl-loadconfig-p config).
    loc — Location information in case of error messages.
        Guard (vl-location-p loc).
    Returns
    successp — Type (booleanp successp).
    actuals — Type (string-listp actuals).
    remainder — Remainder of the input stream after eating all the actuals and also the closing paren.
        Type (vl-echarlist-p remainder), given (force (vl-echarlist-p echars)).

    Definitions and Theorems

    Function: vl-parse-define-actuals

    (defun vl-parse-define-actuals (name echars config loc)
      (declare (xargs :guard (and (stringp name)
                                  (vl-echarlist-p echars)
                                  (vl-loadconfig-p config)
                                  (vl-location-p loc))))
      (let ((__function__ 'vl-parse-define-actuals))
        (declare (ignorable __function__))
        (b* (((mv successp morep actual1 echars)
              (vl-parse-define-actual name echars config loc nil nil))
             ((unless successp) (mv nil nil echars))
             ((unless morep)
              (mv t (list actual1) echars))
             ((mv successp rest-actuals echars)
              (vl-parse-define-actuals name echars config loc))
             ((unless successp) (mv nil nil echars)))
          (mv t (cons actual1 rest-actuals)
              echars))))

    Theorem: booleanp-of-vl-parse-define-actuals.successp

    (defthm booleanp-of-vl-parse-define-actuals.successp
      (b* (((mv ?successp ?actuals ?remainder)
            (vl-parse-define-actuals name echars config loc)))
        (booleanp successp))
      :rule-classes :type-prescription)

    Theorem: string-listp-of-vl-parse-define-actuals.actuals

    (defthm string-listp-of-vl-parse-define-actuals.actuals
      (b* (((mv ?successp ?actuals ?remainder)
            (vl-parse-define-actuals name echars config loc)))
        (string-listp actuals))
      :rule-classes :rewrite)

    Theorem: vl-echarlist-p-of-vl-parse-define-actuals.remainder

    (defthm vl-echarlist-p-of-vl-parse-define-actuals.remainder
      (implies (force (vl-echarlist-p echars))
               (b* (((mv ?successp ?actuals ?remainder)
                     (vl-parse-define-actuals name echars config loc)))
                 (vl-echarlist-p remainder)))
      :rule-classes :rewrite)