• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
        • Program-execution
        • Introduction
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
        • Implemented-opcodes
        • Proof-utilities
          • System-level-marking-view-proof-utilities
            • Rb-alt
            • Unwind-x86-interpreter-in-marking-view
            • Get-prefixes-alt
            • Get-prefixes-in-system-level-marking-view
            • Program-at-alt
            • Rb-in-system-level-marking-view
            • Xlate-equiv-memory-and-rml08
            • Reasoning-about-page-tables
            • Las-to-pas-two-n-ind-hint
            • Find-l-addrs-from-disjoint-p-of-las-to-pas-1-aux
            • Replace-element
            • Non-marking-view-proof-utilities
            • App-view-proof-utilities
            • Subset-p
            • Disjoint-p
            • Pos
            • Member-p
            • No-duplicates-p
            • Common-system-level-utils
            • Debugging-code-proofs
            • General-memory-utils
            • X86-row-wow-thms
          • To-do
          • Concrete-simulation-examples
          • Model-validation
          • Utils
          • Debugging-code-proofs
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • System-level-marking-view-proof-utilities

    Replace-element

    Signature
    (replace-element x y lst) → *

    Definitions and Theorems

    Function: replace-element

    (defun replace-element (x y lst)
      (declare (xargs :guard t))
      (let ((__function__ 'replace-element))
        (declare (ignorable __function__))
        (if (atom lst)
            lst
          (if (equal (car lst) x)
              (cons y (replace-element x y (cdr lst)))
            (cons (car lst)
                  (replace-element x y (cdr lst)))))))

    Theorem: true-listp-of-replace-element

    (defthm true-listp-of-replace-element
      (implies (true-listp lst)
               (true-listp (replace-element x y lst))))