• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
        • Svex-decomposition-methodology
        • Sv-versus-esim
        • Svex-decomp
        • Svex-compose-dfs
        • Svex-compilation
        • Moddb
        • Svmods
          • Address
          • Wire
            • Wire-fix
            • Wire-p
            • Make-wire
            • Wire-equiv
            • Change-wire
            • Wire->name
            • Wire->low-idx
            • Wire->delay
            • Wire->width
            • Wire->type
            • Wire->atts
            • Wirelist
              • Wirelist-fix
                • Wirelist->names
                • Wirelist-p
                • Wirelist-find
                • Wirelist-equiv
              • Wire->revp
              • Wiretype
            • Module
            • Lhs
            • Path
            • Svar-add-namespace
            • Design
            • Modinst
            • Lhs-add-namespace
            • Modalist
            • Path-add-namespace
            • Modname->submodnames
            • Name
            • Constraintlist-addr-p
            • Svex-alist-addr-p
            • Svar-map-addr-p
            • Lhspairs-addr-p
            • Modname
            • Assigns-addr-p
            • Lhs-addr-p
            • Lhatom-addr-p
            • Modhier-list-measure
            • Attributes
            • Modhier-measure
            • Modhier-list-measure-aux
            • Modhier-loopfreelist-p
            • Modhier-loopfree-p
          • Svstmt
          • Sv-tutorial
          • Expressions
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Wirelist

    Wirelist-fix

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

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

    In the logic, we apply wire-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: wirelist-fix$inline

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

    Theorem: wirelist-p-of-wirelist-fix

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

    Theorem: wirelist-fix-when-wirelist-p

    (defthm wirelist-fix-when-wirelist-p
      (implies (wirelist-p x)
               (equal (wirelist-fix x) x)))

    Function: wirelist-equiv$inline

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

    Theorem: wirelist-equiv-is-an-equivalence

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

    Theorem: wirelist-equiv-implies-equal-wirelist-fix-1

    (defthm wirelist-equiv-implies-equal-wirelist-fix-1
      (implies (wirelist-equiv x x-equiv)
               (equal (wirelist-fix x)
                      (wirelist-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: wirelist-fix-under-wirelist-equiv

    (defthm wirelist-fix-under-wirelist-equiv
      (wirelist-equiv (wirelist-fix x) x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-wirelist-fix-1-forward-to-wirelist-equiv

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

    Theorem: equal-of-wirelist-fix-2-forward-to-wirelist-equiv

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

    Theorem: wirelist-equiv-of-wirelist-fix-1-forward

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

    Theorem: wirelist-equiv-of-wirelist-fix-2-forward

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

    Theorem: car-of-wirelist-fix-x-under-wire-equiv

    (defthm car-of-wirelist-fix-x-under-wire-equiv
      (wire-equiv (car (wirelist-fix x))
                  (car x)))

    Theorem: car-wirelist-equiv-congruence-on-x-under-wire-equiv

    (defthm car-wirelist-equiv-congruence-on-x-under-wire-equiv
      (implies (wirelist-equiv x x-equiv)
               (wire-equiv (car x) (car x-equiv)))
      :rule-classes :congruence)

    Theorem: cdr-of-wirelist-fix-x-under-wirelist-equiv

    (defthm cdr-of-wirelist-fix-x-under-wirelist-equiv
      (wirelist-equiv (cdr (wirelist-fix x))
                      (cdr x)))

    Theorem: cdr-wirelist-equiv-congruence-on-x-under-wirelist-equiv

    (defthm cdr-wirelist-equiv-congruence-on-x-under-wirelist-equiv
      (implies (wirelist-equiv x x-equiv)
               (wirelist-equiv (cdr x) (cdr x-equiv)))
      :rule-classes :congruence)

    Theorem: cons-of-wire-fix-x-under-wirelist-equiv

    (defthm cons-of-wire-fix-x-under-wirelist-equiv
      (wirelist-equiv (cons (wire-fix x) y)
                      (cons x y)))

    Theorem: cons-wire-equiv-congruence-on-x-under-wirelist-equiv

    (defthm cons-wire-equiv-congruence-on-x-under-wirelist-equiv
      (implies (wire-equiv x x-equiv)
               (wirelist-equiv (cons x y)
                               (cons x-equiv y)))
      :rule-classes :congruence)

    Theorem: cons-of-wirelist-fix-y-under-wirelist-equiv

    (defthm cons-of-wirelist-fix-y-under-wirelist-equiv
      (wirelist-equiv (cons x (wirelist-fix y))
                      (cons x y)))

    Theorem: cons-wirelist-equiv-congruence-on-y-under-wirelist-equiv

    (defthm cons-wirelist-equiv-congruence-on-y-under-wirelist-equiv
      (implies (wirelist-equiv y y-equiv)
               (wirelist-equiv (cons x y)
                               (cons x y-equiv)))
      :rule-classes :congruence)

    Theorem: consp-of-wirelist-fix

    (defthm consp-of-wirelist-fix
      (equal (consp (wirelist-fix x))
             (consp x)))

    Theorem: wirelist-fix-under-iff

    (defthm wirelist-fix-under-iff
      (iff (wirelist-fix x) (consp x)))

    Theorem: wirelist-fix-of-cons

    (defthm wirelist-fix-of-cons
      (equal (wirelist-fix (cons a x))
             (cons (wire-fix a) (wirelist-fix x))))

    Theorem: len-of-wirelist-fix

    (defthm len-of-wirelist-fix
      (equal (len (wirelist-fix x)) (len x)))

    Theorem: wirelist-fix-of-append

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

    Theorem: wirelist-fix-of-repeat

    (defthm wirelist-fix-of-repeat
      (equal (wirelist-fix (repeat acl2::n x))
             (repeat acl2::n (wire-fix x))))

    Theorem: list-equiv-refines-wirelist-equiv

    (defthm list-equiv-refines-wirelist-equiv
      (implies (list-equiv x y)
               (wirelist-equiv x y))
      :rule-classes :refinement)

    Theorem: nth-of-wirelist-fix

    (defthm nth-of-wirelist-fix
      (equal (nth acl2::n (wirelist-fix x))
             (if (< (nfix acl2::n) (len x))
                 (wire-fix (nth acl2::n x))
               nil)))

    Theorem: wirelist-equiv-implies-wirelist-equiv-append-1

    (defthm wirelist-equiv-implies-wirelist-equiv-append-1
      (implies (wirelist-equiv x fty::x-equiv)
               (wirelist-equiv (append x y)
                               (append fty::x-equiv y)))
      :rule-classes (:congruence))

    Theorem: wirelist-equiv-implies-wirelist-equiv-append-2

    (defthm wirelist-equiv-implies-wirelist-equiv-append-2
      (implies (wirelist-equiv y fty::y-equiv)
               (wirelist-equiv (append x y)
                               (append x fty::y-equiv)))
      :rule-classes (:congruence))

    Theorem: wirelist-equiv-implies-wirelist-equiv-nthcdr-2

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

    Theorem: wirelist-equiv-implies-wirelist-equiv-take-2

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