• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • 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
          • Elim-supplies
            • Vl-modulelist-elim-supplies
            • Vl-collect-supplies
            • Vl-module-elim-supplies
              • Vl-design-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
    • Elim-supplies

    Vl-module-elim-supplies

    Signature
    (vl-module-elim-supplies x) → new-x
    Arguments
    x — Guard (vl-module-p x).
    Returns
    new-x — Type (vl-module-p new-x).

    Definitions and Theorems

    Function: vl-module-elim-supplies

    (defun vl-module-elim-supplies (x)
     (declare (xargs :guard (vl-module-p x)))
     (let ((__function__ 'vl-module-elim-supplies))
      (declare (ignorable __function__))
      (b*
       (((vl-module x) (vl-module-fix x))
        ((when (vl-module->hands-offp x)) x)
        (palist (vl-make-portdecl-alist x.portdecls))
        ((mv warnings new-decls supply0s supply1s)
         (vl-collect-supplies x.vardecls
                              x.portdecls palist x.warnings))
        (- (fast-alist-free palist))
        ((when (and (not supply0s)
                    (not supply1s)
                    (equal warnings x.warnings)))
         x)
        (x (change-vl-module x
                             :vardecls new-decls
                             :warnings warnings))
        (zeroes
         (replicate
            (length supply0s)
            (make-vl-atom :guts (make-vl-constint :origwidth 1
                                                  :origtype :vl-unsigned
                                                  :value 0)
                          :finalwidth 1
                          :finaltype :vl-unsigned)))
        (ones
         (replicate
            (length supply1s)
            (make-vl-atom :guts (make-vl-constint :origwidth 1
                                                  :origtype :vl-unsigned
                                                  :value 1)
                          :finalwidth 1
                          :finaltype :vl-unsigned)))
        (sigma (revappend (pairlis$ supply0s zeroes)
                          (pairlis$ supply1s ones))))
       (with-fast-alist sigma (vl-module-subst x sigma)))))

    Theorem: vl-module-p-of-vl-module-elim-supplies

    (defthm vl-module-p-of-vl-module-elim-supplies
      (b* ((new-x (vl-module-elim-supplies x)))
        (vl-module-p new-x))
      :rule-classes :rewrite)

    Theorem: vl-module-elim-supplies-of-vl-module-fix-x

    (defthm vl-module-elim-supplies-of-vl-module-fix-x
      (equal (vl-module-elim-supplies (vl-module-fix x))
             (vl-module-elim-supplies x)))

    Theorem: vl-module-elim-supplies-vl-module-equiv-congruence-on-x

    (defthm vl-module-elim-supplies-vl-module-equiv-congruence-on-x
      (implies (vl-module-equiv x x-equiv)
               (equal (vl-module-elim-supplies x)
                      (vl-module-elim-supplies x-equiv)))
      :rule-classes :congruence)