• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
        • Deftagsum
        • Defprod
        • Defflexsum
        • Defbitstruct
        • Deflist
        • Defalist
        • Defbyte
        • Defresult
        • Deffixtype
        • Deffixequiv
        • Fty-discipline
        • Defoption
        • Fty-extensions
        • Defsubtype
        • Deftypes
        • Defflatsum
        • Deflist-of-len
        • Defbytelist
        • Defset
        • Fty::basetypes
        • Specific-types
        • Defvisitors
        • Deffixtype-alias
        • Defomap
        • Deffixequiv-sk
        • Defunit
        • Deffixequiv-mutual
        • Fty::baselists
          • Symbol-list
            • Symbol-list-fix
              • Symbol-list-equiv
            • True-list-list
            • Nat-list
            • Rational-list
            • Integer-list
            • Boolean-list
            • ACL2-number-list
          • Defmap
        • Std/util
        • Apt
        • Defdata
        • Defrstobj
        • Seq
        • Match-tree
        • Defrstobj
        • With-supporters
        • Def-partial-measure
        • Template-subst
        • Soft
        • Defthm-domain
        • Event-macros
        • Def-universal-equiv
        • Def-saved-obligs
        • With-supporters-after
        • Definec
        • Sig
        • Outer-local
        • Data-structures
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Symbol-list

    Symbol-list-fix

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

    Signature
    (symbol-list-fix x) → fty::newx
    Arguments
    x — Guard (symbol-listp x).
    Returns
    fty::newx — Type (symbol-listp fty::newx).

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

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

    Theorem: symbol-listp-of-symbol-list-fix

    (defthm symbol-listp-of-symbol-list-fix
            (b* ((fty::newx (symbol-list-fix$inline x)))
                (symbol-listp fty::newx))
            :rule-classes :rewrite)

    Theorem: symbol-list-fix-when-symbol-listp

    (defthm symbol-list-fix-when-symbol-listp
            (implies (symbol-listp x)
                     (equal (symbol-list-fix x) x)))

    Function: symbol-list-equiv$inline

    (defun symbol-list-equiv$inline (x y)
           (declare (xargs :guard (and (symbol-listp x)
                                       (symbol-listp y))))
           (equal (symbol-list-fix x)
                  (symbol-list-fix y)))

    Theorem: symbol-list-equiv-is-an-equivalence

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

    Theorem: symbol-list-equiv-implies-equal-symbol-list-fix-1

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

    Theorem: symbol-list-fix-under-symbol-list-equiv

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

    Theorem: equal-of-symbol-list-fix-1-forward-to-symbol-list-equiv

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

    Theorem: equal-of-symbol-list-fix-2-forward-to-symbol-list-equiv

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

    Theorem: symbol-list-equiv-of-symbol-list-fix-1-forward

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

    Theorem: symbol-list-equiv-of-symbol-list-fix-2-forward

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

    Theorem: car-of-symbol-list-fix-x-under-symbol-equiv

    (defthm car-of-symbol-list-fix-x-under-symbol-equiv
            (symbol-equiv (car (symbol-list-fix x))
                          (car x)))

    Theorem: car-symbol-list-equiv-congruence-on-x-under-symbol-equiv

    (defthm car-symbol-list-equiv-congruence-on-x-under-symbol-equiv
            (implies (symbol-list-equiv x x-equiv)
                     (symbol-equiv (car x) (car x-equiv)))
            :rule-classes :congruence)

    Theorem: cdr-of-symbol-list-fix-x-under-symbol-list-equiv

    (defthm cdr-of-symbol-list-fix-x-under-symbol-list-equiv
            (symbol-list-equiv (cdr (symbol-list-fix x))
                               (cdr x)))

    Theorem: cdr-symbol-list-equiv-congruence-on-x-under-symbol-list-equiv

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

    Theorem: cons-of-symbol-fix-x-under-symbol-list-equiv

    (defthm cons-of-symbol-fix-x-under-symbol-list-equiv
            (symbol-list-equiv (cons (symbol-fix x) y)
                               (cons x y)))

    Theorem: cons-symbol-equiv-congruence-on-x-under-symbol-list-equiv

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

    Theorem: cons-of-symbol-list-fix-y-under-symbol-list-equiv

    (defthm cons-of-symbol-list-fix-y-under-symbol-list-equiv
            (symbol-list-equiv (cons x (symbol-list-fix y))
                               (cons x y)))

    Theorem: cons-symbol-list-equiv-congruence-on-y-under-symbol-list-equiv

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

    Theorem: consp-of-symbol-list-fix

    (defthm consp-of-symbol-list-fix
            (equal (consp (symbol-list-fix x))
                   (consp x)))

    Theorem: symbol-list-fix-under-iff

    (defthm symbol-list-fix-under-iff
            (iff (symbol-list-fix x) (consp x)))

    Theorem: symbol-list-fix-of-cons

    (defthm symbol-list-fix-of-cons
            (equal (symbol-list-fix (cons a x))
                   (cons (symbol-fix a)
                         (symbol-list-fix x))))

    Theorem: len-of-symbol-list-fix

    (defthm len-of-symbol-list-fix
            (equal (len (symbol-list-fix x))
                   (len x)))

    Theorem: symbol-list-fix-of-append

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

    Theorem: symbol-list-fix-of-repeat

    (defthm symbol-list-fix-of-repeat
            (equal (symbol-list-fix (repeat n x))
                   (repeat n (symbol-fix x))))

    Theorem: list-equiv-refines-symbol-list-equiv

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

    Theorem: nth-of-symbol-list-fix

    (defthm nth-of-symbol-list-fix
            (equal (nth n (symbol-list-fix x))
                   (if (< (nfix n) (len x))
                       (symbol-fix (nth n x))
                       nil)))

    Theorem: symbol-list-equiv-implies-symbol-list-equiv-append-1

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

    Theorem: symbol-list-equiv-implies-symbol-list-equiv-append-2

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

    Theorem: symbol-list-equiv-implies-symbol-list-equiv-nthcdr-2

    (defthm symbol-list-equiv-implies-symbol-list-equiv-nthcdr-2
            (implies (symbol-list-equiv l l-equiv)
                     (symbol-list-equiv (nthcdr n l)
                                        (nthcdr n l-equiv)))
            :rule-classes (:congruence))

    Theorem: symbol-list-equiv-implies-symbol-list-equiv-take-2

    (defthm symbol-list-equiv-implies-symbol-list-equiv-take-2
            (implies (symbol-list-equiv l l-equiv)
                     (symbol-list-equiv (take n l)
                                        (take n l-equiv)))
            :rule-classes (:congruence))