• 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
        • 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-maybe-scopeitem-fix
                  • Vl-maybe-scopeitem-equiv
                  • Vl-maybe-scopeitem-case
                  • Vl-maybe-scopeitem-some
                  • Vl-maybe-scopeitem-none
                  • Vl-maybe-scopeitem-p
                • 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-maybe-scopeitem

    Vl-maybe-scopeitem-fix

    Fixing function for vl-maybe-scopeitem structures.

    Signature
    (vl-maybe-scopeitem-fix x) → new-x
    Arguments
    x — Guard (vl-maybe-scopeitem-p x).
    Returns
    new-x — Type (vl-maybe-scopeitem-p new-x).

    Definitions and Theorems

    Function: vl-maybe-scopeitem-fix$inline

    (defun vl-maybe-scopeitem-fix$inline (x)
      (declare (xargs :guard (vl-maybe-scopeitem-p x)))
      (let ((__function__ 'vl-maybe-scopeitem-fix))
        (declare (ignorable __function__))
        (mbe :logic (cond ((not x) nil)
                          (t (b* ((fty::val (vl-scopeitem-fix x)))
                               fty::val)))
             :exec x)))

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

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

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

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

    Function: vl-maybe-scopeitem-equiv$inline

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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