• 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-iframe
            • Preprocessor-ifdef-minutia
            • Vl-preprocess
            • Vl-preprocess-loop
            • Vl-includeskips
            • Vl-read-until-end-of-define
            • Vl-define-formallist->defaults
            • Vl-define
            • Vl-expand-define
            • Vl-read-include
            • Vl-substitute-into-macro-text
            • Vl-process-ifdef
            • Ppst
            • Vl-read-define-default-text
            • Vl-process-define
            • Preprocessor-include-minutia
            • Vl-trim-for-preproc
            • Vl-line-up-define-formals-and-actuals
              • Vl-process-undef
              • Vl-split-define-text
              • Vl-def-context
              • Vl-process-endif
              • Scan-backward-for-non-whitespace
              • Vl-ifdef-context
              • Scan-backward-for-whitespace
              • Vl-atvl-atts-text
              • Scan-for-non-whitespace
              • Vl-check-remaining-formals-all-have-defaults
              • Vl-process-else
              • Vl-is-compiler-directive-p
              • Vl-includeskips-controller-lookup
              • Vl-ifdef-use-map
              • Vl-defines
              • Vl-def-use-map
              • Vl-nice-bytes
              • Vl-safe-previous-n
              • Vl-safe-next-n
              • Vl-ppst-pad
              • Vl-filename-to-string-literal
              • Vl-maybe-update-filemap
              • *vl-preprocess-clock*
              • Vl-ppst->warnings
              • Vl-ppst->iskips
              • Vl-ppst->ifdefmap
              • Vl-ppst->idcache
              • Vl-istack
              • Vl-ppst->istack
              • Vl-ppst->includes
              • Vl-ppst->filemap
              • Vl-ppst->defmap
              • Vl-ppst->defines
              • Vl-ppst->config
              • Vl-ppst->bytes
              • Vl-ppst->activep
              • Vl-ppst->acc
              • Vl-ppst-record-ifdef-use
              • Vl-ppst-record-def-use
              • Vl-ifdef-context-list
              • Vl-def-context-list
              • Vl-ppst-update-warnings
              • Vl-ppst-update-istack
              • Vl-ppst-update-iskips
              • Vl-ppst-update-includes
              • Vl-ppst-update-ifdefmap
              • Vl-ppst-update-idcache
              • Vl-ppst-update-filemap
              • Vl-ppst-update-defmap
              • Vl-ppst-update-defines
              • Vl-ppst-update-config
              • Vl-ppst-update-activep
              • Vl-ppst-update-bytes
              • Vl-ppst-update-acc
              • Vl-ppst-unsound-nreverse-acc
            • Vl-loadconfig
            • Vl-loadstate
            • Lexer
            • Parser
            • 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
    • Preprocessor

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

    Signature
    (vl-line-up-define-formals-and-actuals 
         formals actuals name loc ppst) 
     
      → 
    (mv successp subst ppst)
    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 ppst)
     (declare (xargs :stobjs (ppst)))
     (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 ppst)
          (let
           ((ppst
             (vl-ppst-fatal :msg "~a0: too many arguments given to ~s1."
                            :args (list loc name))))
           (mv nil nil ppst))))
        ((when (atom actuals))
         (b* (((mv okp ppst)
               (vl-check-remaining-formals-all-have-defaults
                    formals name loc ppst))
              ((when okp)
               (mv t
                   (pairlis$ (vl-define-formallist->names formals)
                             (vl-define-formallist->defaults formals))
                   ppst)))
           (mv nil nil ppst)))
        ((mv okp rest-subst ppst)
         (vl-line-up-define-formals-and-actuals (cdr formals)
                                                (cdr actuals)
                                                name loc ppst))
        ((unless okp) (mv nil nil ppst))
        ((vl-define-formal formal1)
         (car formals))
        (actual1 (vl-trim-for-preproc (car actuals)))
        (value1 (if (and (equal actual1 "") formal1.default)
                    (vl-trim-for-preproc formal1.default)
                  actual1)))
       (mv t
           (cons (cons formal1.name value1)
                 rest-subst)
           ppst))))

    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 ?ppst)
            (vl-line-up-define-formals-and-actuals
                 formals actuals name loc ppst)))
        (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 ?ppst)
            (vl-line-up-define-formals-and-actuals
                 formals actuals name loc ppst)))
        (and (alistp subst)
             (string-listp (alist-keys subst))
             (string-listp (alist-vals subst))))
      :rule-classes :rewrite)