• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
        • Transforms
          • Expression-sizing
          • Occform
          • Oprewrite
          • Expand-functions
          • Delayredux
          • Unparameterization
          • Caseelim
          • Split
          • Selresolve
          • Weirdint-elim
          • Vl-delta
          • Replicate-insts
          • Rangeresolve
          • Propagate
          • Clean-selects
          • Clean-params
          • Blankargs
          • Inline-mods
          • Expr-simp
          • Trunc
          • Always-top
          • Gatesplit
          • Gate-elim
          • Expression-optimization
            • Vl-modulelist-optimize
            • Vl-op-optimize
            • Vl-expr-optimize
            • Vl-plainarglist-optimize
            • Vl-namedarglist-optimize
            • Vl-gateinstlist-optimize
            • Vl-modinstlist-optimize
            • Vl-assignlist-optimize
            • Vl-arguments-optimize
            • Vl-plainarg-optimize
            • Vl-namedarg-optimize
            • Vl-gateinst-optimize
            • Vl-assign-optimize
            • Vl-modinst-optimize
              • Vl-module-optimize
              • Vl-design-optimize
            • Elim-supplies
            • Wildelim
            • Drop-blankports
            • Clean-warnings
            • Addinstnames
            • Custom-transform-hooks
            • Annotate
            • Latchcode
            • Elim-unused-vars
            • Problem-modules
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Expression-optimization

    Vl-modinst-optimize

    Optimize expressions throughout a vl-modinst-p.

    Signature
    (vl-modinst-optimize x ss) → (mv changedp new-x)
    Arguments
    x — Guard (vl-modinst-p x).
    ss — Guard (vl-scopestack-p ss).
    Returns
    changedp — Type (booleanp changedp).
    new-x — Type (vl-modinst-p new-x).

    Definitions and Theorems

    Function: vl-modinst-optimize

    (defun vl-modinst-optimize (x ss)
      (declare (xargs :guard (and (vl-modinst-p x)
                                  (vl-scopestack-p ss))))
      (let ((__function__ 'vl-modinst-optimize))
        (declare (ignorable __function__))
        (b* ((x (vl-modinst-fix x)))
          (b* (((mv changedp args-prime)
                (vl-arguments-optimize (vl-modinst->portargs x)
                                       ss)))
            (if (not changedp)
                (mv nil x)
              (mv t
                  (change-vl-modinst x
                                     :portargs args-prime)))))))

    Theorem: booleanp-of-vl-modinst-optimize.changedp

    (defthm booleanp-of-vl-modinst-optimize.changedp
      (b* (((mv ?changedp ?new-x)
            (vl-modinst-optimize x ss)))
        (booleanp changedp))
      :rule-classes :type-prescription)

    Theorem: vl-modinst-p-of-vl-modinst-optimize.new-x

    (defthm vl-modinst-p-of-vl-modinst-optimize.new-x
      (b* (((mv ?changedp ?new-x)
            (vl-modinst-optimize x ss)))
        (vl-modinst-p new-x))
      :rule-classes :rewrite)

    Theorem: vl-modinst-optimize-of-vl-modinst-fix-x

    (defthm vl-modinst-optimize-of-vl-modinst-fix-x
      (equal (vl-modinst-optimize (vl-modinst-fix x)
                                  ss)
             (vl-modinst-optimize x ss)))

    Theorem: vl-modinst-optimize-vl-modinst-equiv-congruence-on-x

    (defthm vl-modinst-optimize-vl-modinst-equiv-congruence-on-x
      (implies (vl-modinst-equiv x x-equiv)
               (equal (vl-modinst-optimize x ss)
                      (vl-modinst-optimize x-equiv ss)))
      :rule-classes :congruence)

    Theorem: vl-modinst-optimize-of-vl-scopestack-fix-ss

    (defthm vl-modinst-optimize-of-vl-scopestack-fix-ss
      (equal (vl-modinst-optimize x (vl-scopestack-fix ss))
             (vl-modinst-optimize x ss)))

    Theorem: vl-modinst-optimize-vl-scopestack-equiv-congruence-on-ss

    (defthm vl-modinst-optimize-vl-scopestack-equiv-congruence-on-ss
      (implies (vl-scopestack-equiv ss ss-equiv)
               (equal (vl-modinst-optimize x ss)
                      (vl-modinst-optimize x ss-equiv)))
      :rule-classes :congruence)