• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
        • Std/lists/abstract
        • Rev
          • Rev-theorems
          • Defsort
          • List-fix
          • Std/lists/nth
          • Hons-remove-duplicates
          • Std/lists/update-nth
          • Set-equiv
          • Duplicity
          • Prefixp
          • Std/lists/take
          • Std/lists/intersection$
          • Nats-equiv
          • Repeat
          • Index-of
          • All-equalp
          • Sublistp
          • Std/lists/nthcdr
          • Listpos
          • List-equiv
          • Final-cdr
          • Std/lists/append
          • Std/lists/remove
          • Subseq-list
          • Rcons
          • Std/lists/revappend
          • Std/lists/remove-duplicates-equal
          • Std/lists/reverse
          • Std/lists/last
          • Std/lists/resize-list
          • Flatten
          • Suffixp
          • Std/lists/butlast
          • Std/lists/set-difference
          • Std/lists/len
          • Std/lists/intersectp
          • Std/lists/true-listp
          • Intersectp-witness
          • Subsetp-witness
          • Std/lists/remove1-equal
          • Rest-n
          • First-n
          • Std/lists/union
          • Std/lists/add-to-set
          • Append-without-guard
          • Std/lists/subsetp
          • Std/lists/member
        • Std/alists
        • Obags
        • Std/util
        • Std/strings
        • Std/osets
        • Std/io
        • Std/basic
        • Std/system
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • List-utilities
    • Rev

    Rev-theorems

    Some theorems about the library function rev.

    The theorems car-of-rev-rewrite-car-of-last and car-of-last-rewrite-car-of-rev are disabled by default. They may be useful to turn (car (rev ...)) into (car (last ...)) or vice versa. A theory invariants prevents them from being both enabled (which would cause a loop in the rewriter).

    Definitions and Theorems

    Theorem: car-of-rev-rewrite-car-of-last

    (defthm car-of-rev-rewrite-car-of-last
      (equal (car (rev x)) (car (last x))))

    Theorem: car-of-last-rewrite-car-of-rev

    (defthm car-of-last-rewrite-car-of-rev
      (equal (car (last x)) (car (rev x))))