• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Pfcs
      • Wp-gen
      • Dimacs-reader
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Riscv
      • Bitcoin
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
        • Primitive-functions
        • Translated-terms
        • Values
        • Evaluation
        • Program-equivalence
          • Program-equivp
          • Functions
          • Packages
          • Programs
          • Interpreter
          • Evaluation-states
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • 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)))