• 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
          • Module
          • Lhs
          • Path
          • Svar-add-namespace
          • Design
          • Modinst
          • Lhs-add-namespace
          • Modalist
          • Path-add-namespace
          • Modname->submodnames
          • Name
            • Name-p
            • Name-equiv
            • Name-fix
            • Namelist
              • Namelist-fix
                • Namelist-equiv
                • Namelist-p
            • 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
    • Namelist

    Namelist-fix

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

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

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

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

    Theorem: namelist-p-of-namelist-fix

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

    Theorem: namelist-fix-when-namelist-p

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

    Function: namelist-equiv$inline

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

    Theorem: namelist-equiv-is-an-equivalence

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

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

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

    Theorem: namelist-fix-under-namelist-equiv

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

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

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

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

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

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

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

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

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

    Theorem: car-of-namelist-fix-x-under-name-equiv

    (defthm car-of-namelist-fix-x-under-name-equiv
      (name-equiv (car (namelist-fix x))
                  (car x)))

    Theorem: car-namelist-equiv-congruence-on-x-under-name-equiv

    (defthm car-namelist-equiv-congruence-on-x-under-name-equiv
      (implies (namelist-equiv x x-equiv)
               (name-equiv (car x) (car x-equiv)))
      :rule-classes :congruence)

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

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

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

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

    Theorem: cons-of-name-fix-x-under-namelist-equiv

    (defthm cons-of-name-fix-x-under-namelist-equiv
      (namelist-equiv (cons (name-fix x) y)
                      (cons x y)))

    Theorem: cons-name-equiv-congruence-on-x-under-namelist-equiv

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

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

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

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

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

    Theorem: consp-of-namelist-fix

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

    Theorem: namelist-fix-under-iff

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

    Theorem: namelist-fix-of-cons

    (defthm namelist-fix-of-cons
      (equal (namelist-fix (cons a x))
             (cons (name-fix a) (namelist-fix x))))

    Theorem: len-of-namelist-fix

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

    Theorem: namelist-fix-of-append

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

    Theorem: namelist-fix-of-repeat

    (defthm namelist-fix-of-repeat
      (equal (namelist-fix (repeat acl2::n x))
             (repeat acl2::n (name-fix x))))

    Theorem: list-equiv-refines-namelist-equiv

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

    Theorem: nth-of-namelist-fix

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

    Theorem: namelist-equiv-implies-namelist-equiv-append-1

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

    Theorem: namelist-equiv-implies-namelist-equiv-append-2

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

    Theorem: namelist-equiv-implies-namelist-equiv-nthcdr-2

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

    Theorem: namelist-equiv-implies-namelist-equiv-take-2

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