• 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
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
        • Transforms
          • Unparameterization
            • Vl-unparameterize-flow
            • Vl-unparam-inst
            • Vl-unparam-add-to-ledger
            • Vl-scopeinfo-resolve-params
            • Vl-scope-finalize-params
            • Vl-create-unparameterized-interface
            • Vl-create-unparameterized-module
            • Vl-unparam-actualkeys
            • Vl-make-paramdecloverrides
              • Vl-namedparamvaluelist->names
              • Vl-make-paramdecloverrides-indexed
              • Vl-find-namedparamvalue
              • Vl-paramdecloverride
              • Vl-nonlocal-paramdecls
              • Vl-paramdecloverridelist
            • Vl-unparam-class
            • Vl-unparam-instlist
            • Vl-create-unparameterized-class
            • Vl-add-lost-interface-warnings
            • Vl-add-lost-module-warnings
            • Vl-unparam-classlist
            • Vl-interfacelist->orignames
            • Vl-user-signature
            • Vl-interfaceport-default-signature
            • Vl-modulelist->orignames
            • Vl-plainarglist-update-ifports
            • Vl-portlist-interface-signatures
            • Vl-user-signatures
            • Vl-plainarg-update-ifports
            • Vl-unparam-inst->instkey
            • Vl-toplevel-signatures
            • Vl-unparam-basename
            • Vl-genblob-resolve-rejoin-scopeitems
            • Vl-gencase-some-match
            • Vl-gencase-match
            • Vl-package-elaborate
            • Vl-unparam-signature
            • Vl-unparam-ledger
            • Vl-packagelist-elaborate
            • Vl-design-elaborate
            • Vl-unparam-actualkey
            • Vl-make-paramdecloverrides-named
            • Vl-unparameterize-main
            • Vl-recover-modules-lost-from-elaboration
            • Vl-finish-unparameterized-interface
            • Vl-paramdecl-set-default
            • Vl-genblob-rejoin-scopeitems
            • Vl-finish-unparameterized-interfaces
            • Vl-unparam-instkey
            • Vl-finish-unparameterized-module
            • Vl-finish-unparameterized-class
            • Vl-finish-unparameterized-modules
            • Vl-finish-unparameterized-classes
            • Vl-genblob-split-scopeitems
            • Vl-user-paramsettings-for-top-names
            • Vl-string/int-alist-to-namedargs
            • Vl-add-lost-interface-warning
            • Vl-unparam-basename-exprstring
            • Vl-add-lost-module-warning
            • Vl-paramdecllist-remove-defaults
            • Vl-ifport-alist
            • Vl-paramdecl-remove-default
            • Vl-ifportexpr->name
            • Vl-paramdecllist-all-localp
            • Vl-unparam-instkeymap
            • Vl-unparam-donelist
            • Vl-unparam-instkeylist
          • Elaborate
          • Addnames
          • Annotate
          • Clean-warnings
          • Eliminitial
          • Custom-transform-hooks
          • Problem-modules
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Unparameterization

Vl-make-paramdecloverrides

Line up parameter arguments with parameter declarations.

Signature
(vl-make-paramdecloverrides formals 
                            actuals bad-instance-fatalp warnings) 
 
  → 
(mv successp warnings overrides)
Arguments
formals — In proper order, from the submodule.
    Guard (vl-paramdecllist-p formals).
actuals — From the instance.
    Guard (vl-paramargs-p actuals).
bad-instance-fatalp — Guard (booleanp bad-instance-fatalp).
warnings — Warnings accumulator for the superior module.
    Guard (vl-warninglist-p warnings).
Returns
successp — Type (booleanp successp).
warnings — Type (vl-warninglist-p warnings).
overrides — Type (vl-paramdecloverridelist-p overrides).

Definitions and Theorems

Function: vl-make-paramdecloverrides

(defun vl-make-paramdecloverrides
       (formals actuals bad-instance-fatalp warnings)
 (declare (xargs :guard (and (vl-paramdecllist-p formals)
                             (vl-paramargs-p actuals)
                             (booleanp bad-instance-fatalp)
                             (vl-warninglist-p warnings))))
 (let ((__function__ 'vl-make-paramdecloverrides))
  (declare (ignorable __function__))
  (b*
   ((formals (vl-paramdecllist-fix formals))
    ((unless (uniquep (vl-paramdecllist->names formals)))
     (mv
      nil
      (fatal
       :type :vl-paramdecl-names-not-unique
       :msg "parameters are not unique: ~&1."
       :args
       (list
            nil
            (duplicated-members (vl-paramdecllist->names formals))))
      nil)))
   (vl-paramargs-case
    actuals
    (:vl-paramargs-named
     (b*
      ((actual-names (vl-namedparamvaluelist->names actuals.args))
       (?formal-names
         (vl-paramdecllist->names (vl-nonlocal-paramdecls formals)))
       ((unless (uniquep actual-names))
        (mv
         nil
         (fatal
            :type :vl-instance-paramargs-duplicates
            :msg "multiple occurrences of parameter arguments: ~&1."
            :args (list nil (duplicated-members actual-names)))
         nil))
       (illegal-names (difference (mergesort actual-names)
                                  (mergesort formal-names)))
       (warnings
         (if illegal-names
           (warn :type :vl-instance-paramargs-nonexistent
                 :msg "parameter~s1 ~&2 ~s3."
                 :args (list nil
                             (if (vl-plural-p illegal-names) "s" "")
                             illegal-names
                             (if (vl-plural-p illegal-names)
                                 "do not exist"
                               "does not exist"))
                 :fatalp bad-instance-fatalp)
           warnings))
       (overrides
           (vl-make-paramdecloverrides-named formals actuals.args)))
      (mv t (ok) overrides)))
    (:vl-paramargs-plain
     (b*
      ((num-formals (len (vl-nonlocal-paramdecls formals)))
       (num-actuals (len actuals.args))
       ((unless (<= num-actuals num-formals))
        (mv
         nil
         (fatal
          :type :vl-instance-paramargs-wrong-arity
          :msg
          "too many parameter values: ~x1 (non-local) ~
                              parameter~s2, but is given ~x3 parameter argument~s4."
          :args (list nil num-formals
                      (if (eql num-formals 1) "" "s")
                      num-actuals
                      (if (eql num-actuals 1) "" "s")))
         nil))
       (overrides
         (vl-make-paramdecloverrides-indexed formals actuals.args)))
      (mv t (ok) overrides)))))))

Theorem: booleanp-of-vl-make-paramdecloverrides.successp

(defthm booleanp-of-vl-make-paramdecloverrides.successp
  (b* (((mv ?successp ?warnings ?overrides)
        (vl-make-paramdecloverrides
             formals
             actuals bad-instance-fatalp warnings)))
    (booleanp successp))
  :rule-classes :type-prescription)

Theorem: vl-warninglist-p-of-vl-make-paramdecloverrides.warnings

(defthm vl-warninglist-p-of-vl-make-paramdecloverrides.warnings
  (b* (((mv ?successp ?warnings ?overrides)
        (vl-make-paramdecloverrides
             formals
             actuals bad-instance-fatalp warnings)))
    (vl-warninglist-p warnings))
  :rule-classes :rewrite)

Theorem: vl-paramdecloverridelist-p-of-vl-make-paramdecloverrides.overrides

(defthm
 vl-paramdecloverridelist-p-of-vl-make-paramdecloverrides.overrides
 (b* (((mv ?successp ?warnings ?overrides)
       (vl-make-paramdecloverrides
            formals
            actuals bad-instance-fatalp warnings)))
   (vl-paramdecloverridelist-p overrides))
 :rule-classes :rewrite)

Theorem: vl-make-paramdecloverrides-of-vl-paramdecllist-fix-formals

(defthm vl-make-paramdecloverrides-of-vl-paramdecllist-fix-formals
 (equal
   (vl-make-paramdecloverrides (vl-paramdecllist-fix formals)
                               actuals bad-instance-fatalp warnings)
   (vl-make-paramdecloverrides
        formals
        actuals bad-instance-fatalp warnings)))

Theorem: vl-make-paramdecloverrides-vl-paramdecllist-equiv-congruence-on-formals

(defthm
 vl-make-paramdecloverrides-vl-paramdecllist-equiv-congruence-on-formals
 (implies
  (vl-paramdecllist-equiv formals formals-equiv)
  (equal
   (vl-make-paramdecloverrides formals
                               actuals bad-instance-fatalp warnings)
   (vl-make-paramdecloverrides
        formals-equiv
        actuals bad-instance-fatalp warnings)))
 :rule-classes :congruence)

Theorem: vl-make-paramdecloverrides-of-vl-paramargs-fix-actuals

(defthm vl-make-paramdecloverrides-of-vl-paramargs-fix-actuals
 (equal
      (vl-make-paramdecloverrides formals (vl-paramargs-fix actuals)
                                  bad-instance-fatalp warnings)
      (vl-make-paramdecloverrides
           formals
           actuals bad-instance-fatalp warnings)))

Theorem: vl-make-paramdecloverrides-vl-paramargs-equiv-congruence-on-actuals

(defthm
 vl-make-paramdecloverrides-vl-paramargs-equiv-congruence-on-actuals
 (implies
  (vl-paramargs-equiv actuals actuals-equiv)
  (equal
   (vl-make-paramdecloverrides formals
                               actuals bad-instance-fatalp warnings)
   (vl-make-paramdecloverrides formals actuals-equiv
                               bad-instance-fatalp warnings)))
 :rule-classes :congruence)

Theorem: vl-make-paramdecloverrides-of-bool-fix-bad-instance-fatalp

(defthm vl-make-paramdecloverrides-of-bool-fix-bad-instance-fatalp
 (equal
    (vl-make-paramdecloverrides formals actuals
                                (acl2::bool-fix bad-instance-fatalp)
                                warnings)
    (vl-make-paramdecloverrides
         formals
         actuals bad-instance-fatalp warnings)))

Theorem: vl-make-paramdecloverrides-iff-congruence-on-bad-instance-fatalp

(defthm
   vl-make-paramdecloverrides-iff-congruence-on-bad-instance-fatalp
 (implies
  (iff bad-instance-fatalp
       bad-instance-fatalp-equiv)
  (equal
   (vl-make-paramdecloverrides formals
                               actuals bad-instance-fatalp warnings)
   (vl-make-paramdecloverrides formals actuals
                               bad-instance-fatalp-equiv warnings)))
 :rule-classes :congruence)

Theorem: vl-make-paramdecloverrides-of-vl-warninglist-fix-warnings

(defthm vl-make-paramdecloverrides-of-vl-warninglist-fix-warnings
 (equal
     (vl-make-paramdecloverrides formals actuals bad-instance-fatalp
                                 (vl-warninglist-fix warnings))
     (vl-make-paramdecloverrides
          formals
          actuals bad-instance-fatalp warnings)))

Theorem: vl-make-paramdecloverrides-vl-warninglist-equiv-congruence-on-warnings

(defthm
 vl-make-paramdecloverrides-vl-warninglist-equiv-congruence-on-warnings
 (implies
  (vl-warninglist-equiv warnings warnings-equiv)
  (equal
   (vl-make-paramdecloverrides formals
                               actuals bad-instance-fatalp warnings)
   (vl-make-paramdecloverrides formals actuals
                               bad-instance-fatalp warnings-equiv)))
 :rule-classes :congruence)

Subtopics

Vl-namedparamvaluelist->names
(vl-namedparamvaluelist->names x) maps vl-namedparamvalue->name across a list.
Vl-make-paramdecloverrides-indexed
Line up positional parameter arguments with parameter declarations.
Vl-find-namedparamvalue
Vl-paramdecloverride
Paired up parameter declaration with its override values from a module instance.
Vl-nonlocal-paramdecls
Filter parameter declarations, keeping only the non-local declarations.
Vl-paramdecloverridelist
A list of vl-paramdecloverride-p objects.