• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • 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
          • 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
            • Attributes-fix
              • Attributes-p
              • Attributes-equiv
            • 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
    • Attributes

    Attributes-fix

    (attributes-fix x) is an fty alist fixing function that follows the fix-keys strategy.

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

    Note that in the execution this is just an inline identity function.

    Definitions and Theorems

    Function: attributes-fix$inline

    (defun attributes-fix$inline (x)
      (declare (xargs :guard (attributes-p x)))
      (let ((__function__ 'attributes-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (if (atom x)
                 nil
               (if (consp (car x))
                   (cons (cons (str-fix (caar x))
                               (maybe-svex-fix (cdar x)))
                         (attributes-fix (cdr x)))
                 (attributes-fix (cdr x))))
             :exec x)))

    Theorem: attributes-p-of-attributes-fix

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

    Theorem: attributes-fix-when-attributes-p

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

    Function: attributes-equiv$inline

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

    Theorem: attributes-equiv-is-an-equivalence

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

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

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

    Theorem: attributes-fix-under-attributes-equiv

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

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

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

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

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

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

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

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

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

    Theorem: cons-of-str-fix-k-under-attributes-equiv

    (defthm cons-of-str-fix-k-under-attributes-equiv
      (attributes-equiv (cons (cons (str-fix acl2::k) acl2::v)
                              x)
                        (cons (cons acl2::k acl2::v) x)))

    Theorem: cons-streqv-congruence-on-k-under-attributes-equiv

    (defthm cons-streqv-congruence-on-k-under-attributes-equiv
      (implies (acl2::streqv acl2::k k-equiv)
               (attributes-equiv (cons (cons acl2::k acl2::v) x)
                                 (cons (cons k-equiv acl2::v) x)))
      :rule-classes :congruence)

    Theorem: cons-of-maybe-svex-fix-v-under-attributes-equiv

    (defthm cons-of-maybe-svex-fix-v-under-attributes-equiv
      (attributes-equiv (cons (cons acl2::k (maybe-svex-fix acl2::v))
                              x)
                        (cons (cons acl2::k acl2::v) x)))

    Theorem: cons-maybe-svex-equiv-congruence-on-v-under-attributes-equiv

    (defthm cons-maybe-svex-equiv-congruence-on-v-under-attributes-equiv
      (implies (maybe-svex-equiv acl2::v v-equiv)
               (attributes-equiv (cons (cons acl2::k acl2::v) x)
                                 (cons (cons acl2::k v-equiv) x)))
      :rule-classes :congruence)

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

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

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

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

    Theorem: attributes-fix-of-acons

    (defthm attributes-fix-of-acons
      (equal (attributes-fix (cons (cons acl2::a acl2::b) x))
             (cons (cons (str-fix acl2::a)
                         (maybe-svex-fix acl2::b))
                   (attributes-fix x))))

    Theorem: attributes-fix-of-append

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

    Theorem: consp-car-of-attributes-fix

    (defthm consp-car-of-attributes-fix
      (equal (consp (car (attributes-fix x)))
             (consp (attributes-fix x))))