• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
          • Primitive-functions
          • Translated-terms
          • Values
          • Evaluation
          • Program-equivalence
          • Functions
          • Packages
          • Programs
          • Interpreter
          • Evaluation-states
            • Eval-state
            • Frame
            • Binding
            • Stack
              • Stack-fix
              • Stack-equiv
                • Stackp
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Stack

    Stack-equiv

    Basic equivalence relation for stack structures.

    Definitions and Theorems

    Function: stack-equiv$inline

    (defun stack-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (stackp acl2::x)
                                  (stackp acl2::y))))
      (equal (stack-fix acl2::x)
             (stack-fix acl2::y)))

    Theorem: stack-equiv-is-an-equivalence

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

    Theorem: stack-equiv-implies-equal-stack-fix-1

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

    Theorem: stack-fix-under-stack-equiv

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

    Theorem: equal-of-stack-fix-1-forward-to-stack-equiv

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

    Theorem: equal-of-stack-fix-2-forward-to-stack-equiv

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

    Theorem: stack-equiv-of-stack-fix-1-forward

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

    Theorem: stack-equiv-of-stack-fix-2-forward

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