• 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
            • Program-equivp
            • Functions
            • Packages
            • Programs
            • Interpreter
            • Evaluation-states
          • 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
    • Program-equivalence

    Program-equivp

    Equivalence of two programs.

    This binary relation is indeed an equivalence: reflexive, symmetric, and transitive.

    Definitions and Theorems

    Theorem: program-equivp-necc

    (defthm program-equivp-necc
      (implies
           (program-equivp program1 program2)
           (implies (and (symbol-valuep function)
                         (value-listp arguments))
                    (equal (exec-call function arguments program1)
                           (exec-call function arguments program2)))))

    Theorem: booleanp-of-program-equivp

    (defthm booleanp-of-program-equivp
      (b* ((yes/no (program-equivp program1 program2)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: program-equivp-reflexive

    (defthm program-equivp-reflexive
      (program-equivp program program))

    Theorem: program-equivp-symmetic

    (defthm program-equivp-symmetic
      (implies (program-equivp program1 program2)
               (program-equivp program2 program1))
      :rule-classes nil)

    Theorem: program-equivp-transitive

    (defthm program-equivp-transitive
      (implies (and (program-equivp program1 program2)
                    (program-equivp program2 program3))
               (program-equivp program1 program3)))