• 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
        • Lint
        • Mlib
          • Scopestack
            • Vl-interfaceportlist->ifnames
            • Vl-scope-find-item
            • Vl-blockscope
            • Vl-importlist-find-explicit-item
            • Vl-scopestack-find-item/context
            • Vl-importlist-find-implicit-item
            • Vl-import-stars-find-item
            • Vl-importlist->explicit-item-alist
            • Vl-scopestack-find-definition/ss
            • Vl-scopeitem
              • Vl-scopeitem-p
              • Vl-scopeitem-fix
                • Vl-maybe-scopeitem
                • Vl-scopeitem-equiv
                • Vl-scopeitem-alist-count
                • Vl-scopeitem-alist
                • Vl-scopeitemlist
              • Vl-scopestack-find-package/ss
              • Vl-scopeinfo-find-item
              • Vl-scopestack-find-item/ss
              • Vl-scopestack
              • Vl-scopeinfo
              • Scopestack-constants
              • Vl-scopestack-push
              • Vl-scope->scopeinfo
              • Vl-scope-find-item-fast
              • Vl-module-scope-find-item
              • Vl-importresult
              • Vl-genblob-scope-find-item
              • Vl-design-scope-find-definition
              • Vl-scopestack-find-item
              • Vl-scopestack-find-definition
              • Vl-scope-find-portdecl
              • Vl-scope-find-definition
              • Vl-package-scope-find-item
              • Vl-interface-scope-find-portdecl
              • Vl-interface-scope-find-item
              • Vl-genblob-scope-find-portdecl
              • Vl-design-scope-find-item
              • Vl-blockscope-scope-find-item
              • Vl-scopestack-find-package
              • Vl-scope-find-package
              • Vl-module-scope-find-portdecl
              • Vl-design-scope-find-package
              • Vl-scope-find-portdecl-fast
              • Vl-package-scope-item-alist-top
              • Vl-scopedef
              • Vl-scope-portdecl-alist
              • Vl-scope-package-alist
              • Vl-scope-find-definition-fast
              • Vl-scope-definition-alist
              • Vl-scope-find-package-fast
              • Vl-scopestack->path-aux
              • Vl-scopestack->path
              • Vl-scopestack->design
              • Vl-scopestack-init
              • Vl-scopeitem->name
              • Vl-importlist->star-packages
              • Vl-scopestack-pop
              • Vl-scopestack-nesting-level
              • Vl-scope
              • Vl-design-scope-package-alist-top
              • Vl-scopestack-toplevel-p
              • Vl-scope->name
              • Vl-scopestacks-free
              • Vl-importresult-alist
            • Filtering-by-name
            • Vl-namefactory
            • Substitution
            • Allexprs
            • Hid-tools
            • Vl-consteval
            • Range-tools
            • Lvalexprs
            • Hierarchy
            • Finding-by-name
            • Expr-tools
            • Expr-slicing
            • Stripping-functions
            • Stmt-tools
            • Modnamespace
            • Vl-parse-expr-from-str
            • Welltyped
            • Reordering-by-name
            • Flat-warnings
            • Genblob
            • Expr-building
            • Datatype-tools
            • Syscalls
            • Relocate
            • Expr-cleaning
            • Namemangle
            • Caremask
            • Port-tools
            • Lvalues
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Vl-scopeitem

    Vl-scopeitem-fix

    (vl-scopeitem-fix x) is a ACL2::fty fixing function.

    Signature
    (vl-scopeitem-fix x) → fty::newx
    Arguments
    x — Guard (vl-scopeitem-p x).
    Returns
    fty::newx — Type (vl-scopeitem-p fty::newx).

    Note that in the execution this is just an inline identity function.

    Definitions and Theorems

    Function: vl-scopeitem-fix$inline

    (defun vl-scopeitem-fix$inline (x)
      (declare (xargs :guard (vl-scopeitem-p x)))
      (let ((__function__ 'vl-scopeitem-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (common-lisp::case (tag x)
               ((:vl-modport) (vl-modport-fix x))
               ((:vl-modinst) (vl-modinst-fix x))
               ((:vl-gateinst) (vl-gateinst-fix x))
               ((:vl-genloop :vl-genif
                             :vl-gencase :vl-genblock
                             :vl-genarray :vl-genbase)
                (vl-genelement-fix x))
               ((:vl-interfaceport)
                (vl-interfaceport-fix x))
               ((:vl-paramdecl) (vl-paramdecl-fix x))
               ((:vl-vardecl) (vl-vardecl-fix x))
               ((:vl-fundecl) (vl-fundecl-fix x))
               ((:vl-taskdecl) (vl-taskdecl-fix x))
               (otherwise (vl-typedef-fix x)))
             :exec x)))

    Theorem: vl-scopeitem-p-of-vl-scopeitem-fix

    (defthm vl-scopeitem-p-of-vl-scopeitem-fix
      (b* ((fty::newx (vl-scopeitem-fix$inline x)))
        (vl-scopeitem-p fty::newx))
      :rule-classes :rewrite)

    Theorem: vl-scopeitem-fix-when-vl-scopeitem-p

    (defthm vl-scopeitem-fix-when-vl-scopeitem-p
      (implies (vl-scopeitem-p x)
               (equal (vl-scopeitem-fix x) x)))

    Function: vl-scopeitem-equiv$inline

    (defun vl-scopeitem-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (vl-scopeitem-p acl2::x)
                                  (vl-scopeitem-p acl2::y))))
      (equal (vl-scopeitem-fix acl2::x)
             (vl-scopeitem-fix acl2::y)))

    Theorem: vl-scopeitem-equiv-is-an-equivalence

    (defthm vl-scopeitem-equiv-is-an-equivalence
      (and (booleanp (vl-scopeitem-equiv x y))
           (vl-scopeitem-equiv x x)
           (implies (vl-scopeitem-equiv x y)
                    (vl-scopeitem-equiv y x))
           (implies (and (vl-scopeitem-equiv x y)
                         (vl-scopeitem-equiv y z))
                    (vl-scopeitem-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: vl-scopeitem-equiv-implies-equal-vl-scopeitem-fix-1

    (defthm vl-scopeitem-equiv-implies-equal-vl-scopeitem-fix-1
      (implies (vl-scopeitem-equiv acl2::x x-equiv)
               (equal (vl-scopeitem-fix acl2::x)
                      (vl-scopeitem-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: vl-scopeitem-fix-under-vl-scopeitem-equiv

    (defthm vl-scopeitem-fix-under-vl-scopeitem-equiv
      (vl-scopeitem-equiv (vl-scopeitem-fix acl2::x)
                          acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-vl-scopeitem-fix-1-forward-to-vl-scopeitem-equiv

    (defthm equal-of-vl-scopeitem-fix-1-forward-to-vl-scopeitem-equiv
      (implies (equal (vl-scopeitem-fix acl2::x)
                      acl2::y)
               (vl-scopeitem-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: equal-of-vl-scopeitem-fix-2-forward-to-vl-scopeitem-equiv

    (defthm equal-of-vl-scopeitem-fix-2-forward-to-vl-scopeitem-equiv
      (implies (equal acl2::x (vl-scopeitem-fix acl2::y))
               (vl-scopeitem-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: vl-scopeitem-equiv-of-vl-scopeitem-fix-1-forward

    (defthm vl-scopeitem-equiv-of-vl-scopeitem-fix-1-forward
      (implies (vl-scopeitem-equiv (vl-scopeitem-fix acl2::x)
                                   acl2::y)
               (vl-scopeitem-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: vl-scopeitem-equiv-of-vl-scopeitem-fix-2-forward

    (defthm vl-scopeitem-equiv-of-vl-scopeitem-fix-2-forward
      (implies (vl-scopeitem-equiv acl2::x (vl-scopeitem-fix acl2::y))
               (vl-scopeitem-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: tag-of-vl-scopeitem-fix-forward

    (defthm tag-of-vl-scopeitem-fix-forward
      (or (equal (tag (vl-scopeitem-fix x))
                 :vl-modport)
          (equal (tag (vl-scopeitem-fix x))
                 :vl-modinst)
          (equal (tag (vl-scopeitem-fix x))
                 :vl-gateinst)
          (equal (tag (vl-scopeitem-fix x))
                 :vl-genloop)
          (equal (tag (vl-scopeitem-fix x))
                 :vl-genif)
          (equal (tag (vl-scopeitem-fix x))
                 :vl-gencase)
          (equal (tag (vl-scopeitem-fix x))
                 :vl-genblock)
          (equal (tag (vl-scopeitem-fix x))
                 :vl-genarray)
          (equal (tag (vl-scopeitem-fix x))
                 :vl-genbase)
          (equal (tag (vl-scopeitem-fix x))
                 :vl-interfaceport)
          (equal (tag (vl-scopeitem-fix x))
                 :vl-paramdecl)
          (equal (tag (vl-scopeitem-fix x))
                 :vl-vardecl)
          (equal (tag (vl-scopeitem-fix x))
                 :vl-fundecl)
          (equal (tag (vl-scopeitem-fix x))
                 :vl-taskdecl)
          (equal (tag (vl-scopeitem-fix x))
                 :vl-typedef))
      :rule-classes
      ((:forward-chaining :trigger-terms ((tag (vl-scopeitem-fix x))))))