• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
      • B*
      • Defunc
      • Fty
        • Deftagsum
        • Defprod
        • Defflexsum
        • Defbitstruct
        • Deflist
        • Defalist
        • Defbyte
        • Deffixequiv
        • Defresult
        • Deffixtype
        • Defoption
        • Fty-discipline
        • Fold
        • Fty-extensions
        • Defsubtype
        • Deftypes
        • Specific-types
        • Defset
        • Defflatsum
        • Deflist-of-len
        • Defbytelist
        • Defomap
        • Fty::basetypes
        • Defvisitors
        • Deffixtype-alias
        • Deffixequiv-sk
        • Defunit
        • Multicase
        • Deffixequiv-mutual
        • Fty::baselists
          • Symbol-list
          • True-list-list
          • Nat-list
          • Rational-list
          • Integer-list
          • Boolean-list
            • Boolean-list-fix
              • Boolean-list-equiv
            • ACL2-number-list
          • Def-enumcase
          • Defmap
        • Apt
        • Std/util
        • 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
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Boolean-list

    Boolean-list-fix

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

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

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

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

    Theorem: boolean-listp-of-boolean-list-fix

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

    Theorem: boolean-list-fix-when-boolean-listp

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

    Function: boolean-list-equiv$inline

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

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

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

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

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

    Theorem: boolean-list-fix-under-boolean-list-equiv

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

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

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

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

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

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

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

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

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

    Theorem: car-of-boolean-list-fix-x-under-iff

    (defthm car-of-boolean-list-fix-x-under-iff
      (iff (car (boolean-list-fix x))
           (car x)))

    Theorem: car-boolean-list-equiv-congruence-on-x-under-iff

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

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

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

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

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

    Theorem: cons-of-bool-fix-x-under-boolean-list-equiv

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

    Theorem: cons-iff-congruence-on-x-under-boolean-list-equiv

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

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

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

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

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

    Theorem: consp-of-boolean-list-fix

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

    Theorem: boolean-list-fix-under-iff

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

    Theorem: boolean-list-fix-of-cons

    (defthm boolean-list-fix-of-cons
      (equal (boolean-list-fix (cons a x))
             (cons (bool-fix a)
                   (boolean-list-fix x))))

    Theorem: len-of-boolean-list-fix

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

    Theorem: boolean-list-fix-of-append

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

    Theorem: boolean-list-fix-of-repeat

    (defthm boolean-list-fix-of-repeat
      (equal (boolean-list-fix (repeat n x))
             (repeat n (bool-fix x))))

    Theorem: list-equiv-refines-boolean-list-equiv

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

    Theorem: nth-of-boolean-list-fix

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

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

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

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

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

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

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

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

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