• 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-modulelist-check-selfassigns
              • Vl-expr-approx-bits
              • Vl-assignlist-check-selfassigns
              • Vl-module-check-selfassigns
                • Vl-assign-check-selfassigns
                • Vl-selfassign-bits
                • Vl-selfassign-bits-from-indices
                • Vl-selfassign-bit
                • Vl-design-check-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
              • 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
    • Selfassigns

    Vl-module-check-selfassigns

    Check the assignments of a module for self-assignments to bits.

    Signature
    (vl-module-check-selfassigns x ss) → new-x
    Arguments
    x — Guard (vl-module-p x).
    ss — Guard (vl-scopestack-p ss).
    Returns
    new-x — Type (vl-module-p new-x).

    (vl-module-check-selfassigns x ss) checks all of the assignments in the module x for selfassigns, and adds any warnings to the module.

    Definitions and Theorems

    Function: vl-module-check-selfassigns

    (defun vl-module-check-selfassigns (x ss)
      (declare (xargs :guard (and (vl-module-p x)
                                  (vl-scopestack-p ss))))
      (let ((__function__ 'vl-module-check-selfassigns))
        (declare (ignorable __function__))
        (b* (((vl-module x) (vl-module-fix x))
             ((unless x.assigns) x)
             (ss (vl-scopestack-push x ss))
             (warnings (vl-assignlist-check-selfassigns x.assigns ss))
             ((unless warnings) x))
          (change-vl-module x
                            :warnings (append warnings x.warnings)))))

    Theorem: vl-module-p-of-vl-module-check-selfassigns

    (defthm vl-module-p-of-vl-module-check-selfassigns
      (b* ((new-x (vl-module-check-selfassigns x ss)))
        (vl-module-p new-x))
      :rule-classes :rewrite)

    Theorem: vl-module-check-selfassigns-of-vl-module-fix-x

    (defthm vl-module-check-selfassigns-of-vl-module-fix-x
      (equal (vl-module-check-selfassigns (vl-module-fix x)
                                          ss)
             (vl-module-check-selfassigns x ss)))

    Theorem: vl-module-check-selfassigns-vl-module-equiv-congruence-on-x

    (defthm vl-module-check-selfassigns-vl-module-equiv-congruence-on-x
      (implies (vl-module-equiv x x-equiv)
               (equal (vl-module-check-selfassigns x ss)
                      (vl-module-check-selfassigns x-equiv ss)))
      :rule-classes :congruence)

    Theorem: vl-module-check-selfassigns-of-vl-scopestack-fix-ss

    (defthm vl-module-check-selfassigns-of-vl-scopestack-fix-ss
      (equal (vl-module-check-selfassigns x (vl-scopestack-fix ss))
             (vl-module-check-selfassigns x ss)))

    Theorem: vl-module-check-selfassigns-vl-scopestack-equiv-congruence-on-ss

    (defthm
       vl-module-check-selfassigns-vl-scopestack-equiv-congruence-on-ss
      (implies (vl-scopestack-equiv ss ss-equiv)
               (equal (vl-module-check-selfassigns x ss)
                      (vl-module-check-selfassigns x ss-equiv)))
      :rule-classes :congruence)