• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
          • Vl-lint
            • Vl-lintconfig-p
            • Condcheck
            • Lint-warning-suppression
            • Lucid
            • Lvaluecheck
            • Vl-interfacelist-alwaysstyle
            • Truncation-warnings
            • Vl-modulelist-alwaysstyle
            • Skip-detection
            • Vl-lint-report
            • Vl-lintresult
            • Vl::vl-design-sv-use-set
            • Oddexpr-check
            • Leftright-check
            • Duplicate-detect
            • Selfassigns
            • *vl-lint-help*
            • Arith-compare-check
            • Dupeinst-check
            • Qmarksize-check
            • Lint-whole-file-suppression
            • Run-vl-lint-main
            • Logicassign
            • Run-vl-lint
            • Vl-print-certain-warnings
            • Duperhs-check
            • Vl-lint-top
            • Sd-filter-problems
            • Vl-modulelist-add-svbad-warnings
            • Vl-module-add-svbad-warnings
            • Check-case
            • Vl-lint-extra-actions
            • Drop-lint-stubs
            • Vl-lint-print-warnings
            • 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-lintconfig-loadconfig
              • Vl-lint-design->svex-modalist-wrapper
              • Vl-delete-sd-problems-for-modnames-aux
              • Vl-collect-new-names-from-orignames
              • Vl-lint-print-all-warnings
              • Vl-design-remove-unnecessary-modules
              • Vl-delete-sd-problems-for-modnames
              • Vl-always-check-style
              • Vl-vardecllist-svbad-warnings
              • Vl-vardecl-svbad-warnings
              • Vl-reportcard-remove-suppressed
              • Vl-reportcard-keep-suppressed
              • Vl-alwayslist-check-style
              • Vl-remove-nameless-descriptions
              • Vl-lint-apply-quiet
              • Vl-warninglist-remove-suppressed
              • Vl-warninglist-keep-suppressed
              • Vl-print-eliminated-descs
              • Vl-module-alwaysstyle
              • Vl-jp-reportcard-aux
              • Vl-interface-alwaysstyle
              • Vl-design-alwaysstyle
              • Vl-jp-description-locations
              • Vl-jp-reportcard
              • Vl-pp-stringlist-lines
              • Vl-jp-design-locations
              • Vl-datatype-svbad-p
              • Unpacked-range-check
              • Sd-problem-major-p
              • Vl-alwaysstyle
            • Vl-server
            • Vl-gather
            • Vl-zip
            • Vl-main
            • Split-plusargs
            • Vl-shell
            • Vl-json
          • Mlib
          • Transforms
        • 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)