• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
        • Transforms
        • Lint
          • Vl-lintconfig-p
          • Lucid
          • Skip-detection
          • Vl-lintresult-p
          • Lint-warning-suppression
          • Condcheck
          • Selfassigns
          • Leftright-check
          • Dupeinst-check
          • Oddexpr-check
          • Remove-toohard
          • Qmarksize-check
          • Portcheck
          • Duplicate-detect
          • Vl-print-certain-warnings
          • Duperhs-check
          • *vl-lint-help*
          • Lint-stmt-rewrite
          • Drop-missing-submodules
          • Check-case
          • Drop-user-submodules
            • Vl-modulelist-drop-user-submodules-aux
            • Vl-module-drop-user-submodules
              • Vl-modulelist-drop-user-submodules
              • Vl-design-drop-user-submodules
            • Check-namespace
            • Vl-lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Drop-user-submodules

    Vl-module-drop-user-submodules

    Remove instances of modules that we're supposed to drop.

    Signature
    (vl-module-drop-user-submodules x names fal) → new-x
    Arguments
    x — Module to rewrite.
        Guard (vl-module-p x).
    names — List of module names to drop.
        Guard (string-listp names).
    fal — Precomputed fast alist for names.
        Guard (equal fal (make-lookup-alist names)).
    Returns
    new-x — Type (vl-module-p new-x).

    Definitions and Theorems

    Function: vl-module-drop-user-submodules

    (defun vl-module-drop-user-submodules (x names fal)
     (declare
          (xargs :guard (and (vl-module-p x)
                             (string-listp names)
                             (equal fal (make-lookup-alist names)))))
     (let ((__function__ 'vl-module-drop-user-submodules))
      (declare (ignorable __function__))
      (b*
       ((x (vl-module-fix x))
        ((vl-module x) x)
        ((mv bad-insts good-insts)
         (vl-filter-modinsts-by-modname+ names x.modinsts fal))
        ((when bad-insts)
         (b*
          ((nbad (len bad-insts))
           (bad-names (mergesort (vl-modinstlist->modnames bad-insts)))
           (warnings
            (fatal
             :type :vl-dropped-insts
             :msg
             "In module ~m0, deleting ~x1 submodule ~
                                         instance~s2 because ~s3 to the module~s4 ~
                                         ~&5, which we have been told to drop.  ~
                                         These deletions might cause our analysis ~
                                         to be flawed."
             :args (list x.name nbad (if (eql nbad 1) "" "s")
                         (if (eql nbad 1)
                             "it refers"
                           "they refer")
                         (if (vl-plural-p bad-names) "s" "")
                         bad-names)
             :acc x.warnings)))
          (change-vl-module x
                            :modinsts good-insts
                            :warnings warnings))))
       x)))

    Theorem: vl-module-p-of-vl-module-drop-user-submodules

    (defthm vl-module-p-of-vl-module-drop-user-submodules
      (b* ((new-x (vl-module-drop-user-submodules x names fal)))
        (vl-module-p new-x))
      :rule-classes :rewrite)

    Theorem: vl-module-drop-user-submodules-of-vl-module-fix-x

    (defthm vl-module-drop-user-submodules-of-vl-module-fix-x
      (equal (vl-module-drop-user-submodules (vl-module-fix x)
                                             names fal)
             (vl-module-drop-user-submodules x names fal)))

    Theorem: vl-module-drop-user-submodules-vl-module-equiv-congruence-on-x

    (defthm
         vl-module-drop-user-submodules-vl-module-equiv-congruence-on-x
      (implies
           (vl-module-equiv x x-equiv)
           (equal (vl-module-drop-user-submodules x names fal)
                  (vl-module-drop-user-submodules x-equiv names fal)))
      :rule-classes :congruence)

    Theorem: vl-module-drop-user-submodules-of-string-list-fix-names

    (defthm vl-module-drop-user-submodules-of-string-list-fix-names
      (equal (vl-module-drop-user-submodules x (string-list-fix names)
                                             fal)
             (vl-module-drop-user-submodules x names fal)))

    Theorem: vl-module-drop-user-submodules-string-list-equiv-congruence-on-names

    (defthm
     vl-module-drop-user-submodules-string-list-equiv-congruence-on-names
     (implies
          (str::string-list-equiv names names-equiv)
          (equal (vl-module-drop-user-submodules x names fal)
                 (vl-module-drop-user-submodules x names-equiv fal)))
     :rule-classes :congruence)