• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
          • Scopestack
            • Vl-interfaceportlist->ifnames
            • Vl-blockscope
            • Vl-scope-find-item
            • Vl-scopestack-find-item/ss/package
            • Vl-importlist-find-explicit-item
            • Vl-scopestack-find-item/context
            • Vl-importlist-find-implicit-item
            • Vl-import-stars-find-item
            • Vl-scopeinfo
            • Vl-importlist->explicit-item-alist
            • Vl-scopestack-find-definition/ss
            • Vl-scopeitem
            • Vl-scopestack-find-package/ss
            • Vl-scopestack
            • Vl-scopeinfo-find-item
            • Vl-scopestack-find-item/ss
            • Vl-scopestack-find-class/ss
            • Scopestack-constants
            • Vl-scope-namespace
            • Vl-maybe-scope
            • Vl-importresult
            • Vl-scopestack-push
            • Vl-import-stars-itemnames
            • Vl-scope->scopeinfo
            • Vl-scope-find-item-fast
            • Vl-interface-scope-find-item
            • Vl-genblob-scope-find-item
            • Vl-module-scope-find-item
            • Vl-design-scope-find-definition
            • Vl-scopestack-find-item
            • Vl-scopestack-find-definition
            • Vl-scopeinfo->itemnames
            • Vl-scope-find-portdecl
            • Vl-scope-find-definition
            • Vl-package-scope-find-item
            • Vl-interface-scope-find-portdecl
            • 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-design-scope-find-class
            • Vl-class-scope-find-item
            • Vl-scopestack-find-class
            • Vl-scope-find-class
            • Vl-scopestack->hashkey
            • Vl-scope-find-portdecl-fast
            • Vl-package-scope-item-alist-top
            • Vl-scopestack->path-aux
            • 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-scope-find-class-fast
            • Vl-scope-class-alist
            • Vl-scopestack->path
            • Vl-scopestack->design
            • Vl-scopeitem->name
            • Vl-scope
              • Vl-scope-p
              • Vl-scope-fix
                • Vl-scope-equiv
              • Vl-scopestack-init
              • Vl-importlist->star-packages
              • Vl-scopestack-pop
              • Vl-scopestack-nesting-level
              • Vl-scopestack->toplevel
              • Vl-scope->scopetype
              • Vl-scope->id
              • Vl-design-scope-package-alist-top
              • Vl-bindlist->modinsts
              • Vl-scopestack-toplevel-p
              • Vl-scopestacks-free
              • Vl-importresult-alist
            • Hid-tools
            • Filtering-by-name
            • Vl-interface-mocktype
            • Stripping-functions
            • Genblob
            • Expr-tools
            • Extract-vl-types
            • Hierarchy
            • Range-tools
            • Finding-by-name
            • Stmt-tools
            • Modnamespace
            • Flat-warnings
            • Reordering-by-name
            • Datatype-tools
            • Syscalls
            • Allexprs
            • Lvalues
            • Port-tools
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Vl-scope

    Vl-scope-fix

    (vl-scope-fix x) is a fty fixing function.

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

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

    Definitions and Theorems

    Function: vl-scope-fix$inline

    (defun vl-scope-fix$inline (x)
      (declare (xargs :guard (vl-scope-p x)))
      (let ((__function__ 'vl-scope-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (common-lisp::case (tag x)
               ((:vl-interface) (vl-interface-fix x))
               ((:vl-module) (vl-module-fix x))
               ((:vl-class) (vl-class-fix x))
               ((:vl-genblob) (vl-genblob-fix x))
               ((:vl-blockscope) (vl-blockscope-fix x))
               ((:vl-design) (vl-design-fix x))
               ((:vl-package) (vl-package-fix x))
               (otherwise (vl-scopeinfo-fix x)))
             :exec x)))

    Theorem: vl-scope-p-of-vl-scope-fix

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

    Theorem: vl-scope-fix-when-vl-scope-p

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

    Function: vl-scope-equiv$inline

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

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

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

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

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

    Theorem: vl-scope-fix-under-vl-scope-equiv

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

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

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

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

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

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

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

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

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

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

    (defthm tag-of-vl-scope-fix-forward
      (or (equal (tag (vl-scope-fix x))
                 :vl-interface)
          (equal (tag (vl-scope-fix x))
                 :vl-module)
          (equal (tag (vl-scope-fix x)) :vl-class)
          (equal (tag (vl-scope-fix x))
                 :vl-genblob)
          (equal (tag (vl-scope-fix x))
                 :vl-blockscope)
          (equal (tag (vl-scope-fix x))
                 :vl-design)
          (equal (tag (vl-scope-fix x))
                 :vl-package)
          (equal (tag (vl-scope-fix x))
                 :vl-scopeinfo))
      :rule-classes
      ((:forward-chaining :trigger-terms ((tag (vl-scope-fix x))))))