• 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
        • Transforms
          • Unparameterization
          • Elaborate
          • Addnames
          • Annotate
            • Increment-elim
            • Make-implicit-wires
              • Shadowcheck
                • Vl-shadowcheck-genelement
                • Vl-shadowcheck-reference-name
                • Vl-shadowcheck-declare-name
                • Deltemps
                • Vl-shadowcheck-modelement
                • Vl-lexscope
                • Vl-shadowcheck-reference-scopeexpr
                • Vl-shadowcheck-reference-names
                • Vl-shadowcheck-declare-names
                • Vl-shadowcheck-paramtype
                • Vl-shadowcheck-fun/task-loaditems
                • Vl-shadowcheck-fun/task-loaditem
                • Vl-shadowcheck-fundecl
                • Vl-shadowcheck-declare-typedefs
                • Vl-shadowcheck-blockitemlist
                • Vl-shadowcheck-portdecllist
                • Vl-shadowcheck-paramdecls
                • Vl-shadowcheck-dpiimports
                • Vl-shadowcheck-taskdecls
                • Vl-shadowcheck-taskdecl
                • Vl-shadowcheck-push-scope
                • Vl-shadowcheck-blockitem
                • Vl-shadowcheck-vardecls
                • Vl-shadowcheck-vardecl
                • Vl-shadowcheck-typedef
                • Vl-shadowcheck-portdecl
                • Vl-shadowcheck-paramdecl
                • Vl-shadowcheck-modport
                • Vl-shadowcheck-modinst
                • Vl-shadowcheck-imports
                • Vl-shadowcheck-import
                • Vl-shadowcheck-gateinst
                • Vl-shadowcheck-fundecls
                • Vl-shadowcheck-dpiimport
                • Vl-shadowcheck-ports
                • Vl-shadowcheck-port
                • Vl-shadowcheck-initial
                • Vl-shadowcheck-assign
                • Vl-shadowcheck-always
                • Vl-shadowcheck-final
                • Vl-shadowcheck-alias
                • Vl-shadowcheck-state
                • Vl-shadowcheck-module
                • Vl-shadowcheck-interface
                • Vl-shadowcheck-interfaces
                • Vl-shadowcheck-modules
                • Vl-packagemap-find-packages-for-name
                • Vl-shadowcheck-design
                • Vl-lexscopes
                  • Vl-lexscopes-fix
                    • Vl-lexscopes-direct-import-name
                    • Vl-lexscopes-declare-name
                    • Vl-lexscopes-do-import
                    • Vl-lexscopes-find
                    • Vl-lexscopes-equiv
                    • Vl-lexscopes-p
                    • Vl-lexscopes-exit-scope
                    • Vl-lexscopes-enter-new-scope
                  • Vl-expr->maybe-subtype
                  • Vl-shadowcheck-pop-scope
                  • Nameclash
                  • Vl-portdecl-or-blockitem
                  • Vl-lexscope-decls
                  • Vl-packagemap
                  • Vl-portdecl-or-blockitem-list
                • Implicit-wires-minutia
                • Implicit-wires-generate-scoping
                • Vl-genbase-make-implicit-wires
                • Vl-expr-names-for-implicit
                • Vl-make-implicit-wires-main
                • Vl-implicitst
                • Vl-make-port-implicit-wires
                • Vl-import-update-implicit
                • Vl-blockitemlist-update-implicit
                • Vl-blockitem-update-implicit
                • Vl-make-ordinary-implicit-wires
                • Vl-remove-declared-wires
                • Vl-implicitsts-restore-fast-alists
                • Vl-genblock-under-cond-make-implicit-wires
                • Vl-collect-exprs-for-implicit-wires-from-namedargs
                • Vl-genblock-make-implicit-wires
                • Vl-collect-exprs-for-implicit-wires-from-portargs
                • Vl-collect-exprs-for-implicit-wires-from-namedarg
                • Vl-gateinst-exprs-for-implicit-wires
                • Vl-modinst-exprs-for-implicit-wires
                • Vl-genelementlist-make-implicit-wires
                • Vl-packagemap-find-name
              • Basic-bind-elim
              • Argresolve
              • Basicsanity
              • Portdecl-sign
              • Enum-names
              • Port-resolve
              • Udp-elim
              • Vl-annotate-design
              • Vl-annotate-module
            • Clean-warnings
            • Eliminitial
            • Custom-transform-hooks
            • Problem-modules
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Vl-lexscopes

    Vl-lexscopes-fix

    (vl-lexscopes-fix x) is a usual fty list fixing function.

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

    In the logic, we apply vl-lexscope-fix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.

    Definitions and Theorems

    Function: vl-lexscopes-fix$inline

    (defun vl-lexscopes-fix$inline (x)
      (declare (xargs :guard (vl-lexscopes-p x)))
      (let ((__function__ 'vl-lexscopes-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (if (atom x)
                 x
               (cons (vl-lexscope-fix (car x))
                     (vl-lexscopes-fix (cdr x))))
             :exec x)))

    Theorem: vl-lexscopes-p-of-vl-lexscopes-fix

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

    Theorem: vl-lexscopes-fix-when-vl-lexscopes-p

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

    Function: vl-lexscopes-equiv$inline

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

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

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

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

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

    Theorem: vl-lexscopes-fix-under-vl-lexscopes-equiv

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

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

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

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

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

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

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

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

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

    Theorem: car-of-vl-lexscopes-fix-x-under-vl-lexscope-equiv

    (defthm car-of-vl-lexscopes-fix-x-under-vl-lexscope-equiv
      (vl-lexscope-equiv (car (vl-lexscopes-fix acl2::x))
                         (car acl2::x)))

    Theorem: car-vl-lexscopes-equiv-congruence-on-x-under-vl-lexscope-equiv

    (defthm
         car-vl-lexscopes-equiv-congruence-on-x-under-vl-lexscope-equiv
      (implies (vl-lexscopes-equiv acl2::x x-equiv)
               (vl-lexscope-equiv (car acl2::x)
                                  (car x-equiv)))
      :rule-classes :congruence)

    Theorem: cdr-of-vl-lexscopes-fix-x-under-vl-lexscopes-equiv

    (defthm cdr-of-vl-lexscopes-fix-x-under-vl-lexscopes-equiv
      (vl-lexscopes-equiv (cdr (vl-lexscopes-fix acl2::x))
                          (cdr acl2::x)))

    Theorem: cdr-vl-lexscopes-equiv-congruence-on-x-under-vl-lexscopes-equiv

    (defthm
        cdr-vl-lexscopes-equiv-congruence-on-x-under-vl-lexscopes-equiv
      (implies (vl-lexscopes-equiv acl2::x x-equiv)
               (vl-lexscopes-equiv (cdr acl2::x)
                                   (cdr x-equiv)))
      :rule-classes :congruence)

    Theorem: cons-of-vl-lexscope-fix-x-under-vl-lexscopes-equiv

    (defthm cons-of-vl-lexscope-fix-x-under-vl-lexscopes-equiv
      (vl-lexscopes-equiv (cons (vl-lexscope-fix acl2::x) acl2::y)
                          (cons acl2::x acl2::y)))

    Theorem: cons-vl-lexscope-equiv-congruence-on-x-under-vl-lexscopes-equiv

    (defthm
        cons-vl-lexscope-equiv-congruence-on-x-under-vl-lexscopes-equiv
      (implies (vl-lexscope-equiv acl2::x x-equiv)
               (vl-lexscopes-equiv (cons acl2::x acl2::y)
                                   (cons x-equiv acl2::y)))
      :rule-classes :congruence)

    Theorem: cons-of-vl-lexscopes-fix-y-under-vl-lexscopes-equiv

    (defthm cons-of-vl-lexscopes-fix-y-under-vl-lexscopes-equiv
      (vl-lexscopes-equiv (cons acl2::x (vl-lexscopes-fix acl2::y))
                          (cons acl2::x acl2::y)))

    Theorem: cons-vl-lexscopes-equiv-congruence-on-y-under-vl-lexscopes-equiv

    (defthm
       cons-vl-lexscopes-equiv-congruence-on-y-under-vl-lexscopes-equiv
      (implies (vl-lexscopes-equiv acl2::y y-equiv)
               (vl-lexscopes-equiv (cons acl2::x acl2::y)
                                   (cons acl2::x y-equiv)))
      :rule-classes :congruence)

    Theorem: consp-of-vl-lexscopes-fix

    (defthm consp-of-vl-lexscopes-fix
      (equal (consp (vl-lexscopes-fix acl2::x))
             (consp acl2::x)))

    Theorem: vl-lexscopes-fix-of-cons

    (defthm vl-lexscopes-fix-of-cons
      (equal (vl-lexscopes-fix (cons a x))
             (cons (vl-lexscope-fix a)
                   (vl-lexscopes-fix x))))

    Theorem: len-of-vl-lexscopes-fix

    (defthm len-of-vl-lexscopes-fix
      (equal (len (vl-lexscopes-fix acl2::x))
             (len acl2::x)))

    Theorem: vl-lexscopes-fix-of-append

    (defthm vl-lexscopes-fix-of-append
      (equal (vl-lexscopes-fix (append std::a std::b))
             (append (vl-lexscopes-fix std::a)
                     (vl-lexscopes-fix std::b))))

    Theorem: vl-lexscopes-fix-of-repeat

    (defthm vl-lexscopes-fix-of-repeat
      (equal (vl-lexscopes-fix (repeat acl2::n acl2::x))
             (repeat acl2::n (vl-lexscope-fix acl2::x))))

    Theorem: nth-of-vl-lexscopes-fix

    (defthm nth-of-vl-lexscopes-fix
      (equal (nth acl2::n (vl-lexscopes-fix acl2::x))
             (if (< (nfix acl2::n) (len acl2::x))
                 (vl-lexscope-fix (nth acl2::n acl2::x))
               nil)))

    Theorem: vl-lexscopes-equiv-implies-vl-lexscopes-equiv-append-1

    (defthm vl-lexscopes-equiv-implies-vl-lexscopes-equiv-append-1
      (implies (vl-lexscopes-equiv acl2::x fty::x-equiv)
               (vl-lexscopes-equiv (append acl2::x acl2::y)
                                   (append fty::x-equiv acl2::y)))
      :rule-classes (:congruence))

    Theorem: vl-lexscopes-equiv-implies-vl-lexscopes-equiv-append-2

    (defthm vl-lexscopes-equiv-implies-vl-lexscopes-equiv-append-2
      (implies (vl-lexscopes-equiv acl2::y fty::y-equiv)
               (vl-lexscopes-equiv (append acl2::x acl2::y)
                                   (append acl2::x fty::y-equiv)))
      :rule-classes (:congruence))

    Theorem: vl-lexscopes-equiv-implies-vl-lexscopes-equiv-nthcdr-2

    (defthm vl-lexscopes-equiv-implies-vl-lexscopes-equiv-nthcdr-2
      (implies (vl-lexscopes-equiv acl2::l l-equiv)
               (vl-lexscopes-equiv (nthcdr acl2::n acl2::l)
                                   (nthcdr acl2::n l-equiv)))
      :rule-classes (:congruence))

    Theorem: vl-lexscopes-equiv-implies-vl-lexscopes-equiv-take-2

    (defthm vl-lexscopes-equiv-implies-vl-lexscopes-equiv-take-2
      (implies (vl-lexscopes-equiv acl2::l l-equiv)
               (vl-lexscopes-equiv (take acl2::n acl2::l)
                                   (take acl2::n l-equiv)))
      :rule-classes (:congruence))