• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
      • Ipasir
      • Aignet
      • Aig
      • Satlink
        • Sat-solver-options
        • Config-p
        • Logical-story
        • Dimacs
        • Gather-benchmarks
        • Cnf
          • Litp
            • Lit-negate-cond
            • Lit-negate
            • Make-lit
            • Lit-equiv
            • Lit->var
            • Lit->neg
            • Maybe-litp
            • Lit-list
              • Lit-list-fix
                • Lit-listp
                • Lit-list-equiv
              • Lit-fix
              • Lit-list-list
            • Varp
            • Env$
            • Eval-formula
            • Max-index-formula
            • Max-index-clause
            • Formula-indices
            • Clause-indices
          • Satlink-extra-hook
          • Sat
        • Truth
        • Ubdds
        • Bdd
        • Faig
        • Bed
        • 4v
      • Debugging
      • Projects
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Lit-list

    Lit-list-fix

    (lit-list-fix x) is a usual ACL2::fty list fixing function.

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

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

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

    Theorem: lit-listp-of-lit-list-fix

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

    Theorem: lit-list-fix-when-lit-listp

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

    Function: lit-list-equiv$inline

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

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

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

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

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

    Theorem: lit-list-fix-under-lit-list-equiv

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

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

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

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

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

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

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

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

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

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

    (defthm car-of-lit-list-fix-x-under-lit-equiv
            (lit-equiv (car (lit-list-fix acl2::x))
                       (car acl2::x)))

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

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

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

    (defthm cdr-of-lit-list-fix-x-under-lit-list-equiv
            (lit-list-equiv (cdr (lit-list-fix acl2::x))
                            (cdr acl2::x)))

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

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

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

    (defthm cons-of-lit-fix-x-under-lit-list-equiv
            (lit-list-equiv (cons (lit-fix acl2::x) acl2::y)
                            (cons acl2::x acl2::y)))

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

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

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

    (defthm cons-of-lit-list-fix-y-under-lit-list-equiv
            (lit-list-equiv (cons acl2::x (lit-list-fix acl2::y))
                            (cons acl2::x acl2::y)))

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

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

    Theorem: consp-of-lit-list-fix

    (defthm consp-of-lit-list-fix
            (equal (consp (lit-list-fix acl2::x))
                   (consp acl2::x)))

    Theorem: lit-list-fix-under-iff

    (defthm lit-list-fix-under-iff
            (iff (lit-list-fix acl2::x)
                 (consp acl2::x)))

    Theorem: lit-list-fix-of-cons

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

    Theorem: len-of-lit-list-fix

    (defthm len-of-lit-list-fix
            (equal (len (lit-list-fix acl2::x))
                   (len acl2::x)))

    Theorem: lit-list-fix-of-append

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

    Theorem: lit-list-fix-of-repeat

    (defthm lit-list-fix-of-repeat
            (equal (lit-list-fix (acl2::repeat acl2::n acl2::x))
                   (acl2::repeat acl2::n (lit-fix acl2::x))))

    Theorem: list-equiv-refines-lit-list-equiv

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

    Theorem: nth-of-lit-list-fix

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

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

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

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

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

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

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

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

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