• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • 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-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-read-files
            • Vl-find-file
            • 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
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Testing-utilities
      • Math
    • Preprocessor

    Vl-line-up-define-formals-and-actuals

    Signature
    (vl-line-up-define-formals-and-actuals formals actuals name loc) 
      → 
    (mv successp subst)
    Arguments
    formals — Guard (vl-define-formallist-p formals).
    actuals — Guard (string-listp actuals).
    name — Name of macro being expanded, context for error messages.
        Guard (stringp name).
    loc — Location of macro being expanded, context for error messages.
        Guard (vl-location-p loc).
    Returns
    successp — Type (booleanp successp).
    subst — Type (and (alistp subst) (string-listp (alist-keys subst)) (string-listp (alist-vals subst))) .

    Definitions and Theorems

    Function: vl-line-up-define-formals-and-actuals

    (defun
     vl-line-up-define-formals-and-actuals
     (formals actuals name loc)
     (declare (xargs :guard (and (vl-define-formallist-p formals)
                                 (string-listp actuals)
                                 (stringp name)
                                 (vl-location-p loc))))
     (let
      ((__function__ 'vl-line-up-define-formals-and-actuals))
      (declare (ignorable __function__))
      (b*
       (((when (atom formals))
         (if
          (atom actuals)
          (mv t nil)
          (mv
           (cw
            "Preprocessor error (~s0): too many arguments given to ~s1."
            (vl-location-string loc)
            name)
           nil)))
        ((when (atom actuals))
         (if (vl-check-remaining-formals-all-have-defaults
                  formals name loc)
             (mv t
                 (pairlis$ (vl-define-formallist->names formals)
                           (vl-define-formallist->defaults formals)))
             (mv nil nil)))
        ((mv okp rest-subst)
         (vl-line-up-define-formals-and-actuals (cdr formals)
                                                (cdr actuals)
                                                name loc))
        ((unless okp) (mv nil nil))
        ((vl-define-formal formal1)
         (car formals))
        (actual1 (str::trim (car actuals)))
        (value1 (if (equal actual1 "")
                    (str::trim formal1.default)
                    actual1)))
       (mv t
           (cons (cons formal1.name value1)
                 rest-subst)))))

    Theorem: booleanp-of-vl-line-up-define-formals-and-actuals.successp

    (defthm booleanp-of-vl-line-up-define-formals-and-actuals.successp
            (b* (((mv ?successp common-lisp::?subst)
                  (vl-line-up-define-formals-and-actuals
                       formals actuals name loc)))
                (booleanp successp))
            :rule-classes :type-prescription)

    Theorem: return-type-of-vl-line-up-define-formals-and-actuals.subst

    (defthm return-type-of-vl-line-up-define-formals-and-actuals.subst
            (b* (((mv ?successp common-lisp::?subst)
                  (vl-line-up-define-formals-and-actuals
                       formals actuals name loc)))
                (and (alistp subst)
                     (string-listp (alist-keys subst))
                     (string-listp (alist-vals subst))))
            :rule-classes :rewrite)