• 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-blockscope-fix
                • Vl-blockscope-equiv
                • Make-vl-blockscope
                • Vl-blockscope-p
                • Vl-blockscope->vardecls
                • Vl-blockscope->paramdecls
                • Vl-blockscope->imports
                • Vl-blockscope->name
                • Change-vl-blockscope
                • Vl-taskdecl->blockscope
                • Vl-fundecl->blockscope
                • Vl-blockstmt->blockscope
                • Vl-forstmt->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-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-blockscope

    Vl-blockscope-fix

    Fixing function for vl-blockscope structures.

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

    Definitions and Theorems

    Function: vl-blockscope-fix$inline

    (defun vl-blockscope-fix$inline (x)
     (declare (xargs :guard (vl-blockscope-p x)))
     (let ((__function__ 'vl-blockscope-fix))
      (declare (ignorable __function__))
      (mbe
       :logic
       (b*
        ((imports
            (vl-importlist-fix (std::prod-car (std::prod-car (cdr x)))))
         (paramdecls (vl-paramdecllist-fix
                          (std::prod-cdr (std::prod-car (cdr x)))))
         (vardecls
           (vl-vardecllist-fix (std::prod-car (std::prod-cdr (cdr x)))))
         (name
            (maybe-string-fix (std::prod-cdr (std::prod-cdr (cdr x))))))
        (cons :vl-blockscope
              (std::prod-cons (std::prod-cons imports paramdecls)
                              (std::prod-cons vardecls name))))
       :exec x)))

    Theorem: vl-blockscope-p-of-vl-blockscope-fix

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

    Theorem: vl-blockscope-fix-when-vl-blockscope-p

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

    Function: vl-blockscope-equiv$inline

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

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

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

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

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

    Theorem: vl-blockscope-fix-under-vl-blockscope-equiv

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

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

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

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

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

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

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

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

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