• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Zcash
      • Des
      • X86isa
      • Sha-2
      • Yul
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Axe
      • Poseidon
      • Where-do-i-place-my-book
      • Aleo
        • Aleobft
        • Aleovm
          • Circuits
            • Circuits-pfcs
            • Circuits-r1cs
            • Field-div-flagged
            • Boolean-assert-true
            • Field-inv-flagged
            • Boolean-assert
            • Field-div-unchecked
            • Field-neq
            • Boolean-not
            • Boolean-assert-all
            • Boolean-if
            • Field-if
            • Boolean-xor
            • Boolean-or
            • Boolean-nor
            • Boolean-and
            • Boolean-nand
            • Boolean-neq
              • Boolean-neq-correctness
                • Boolean-neq-spec
                • Boolean-neq-circuit
                • Boolean-neq-lifting
              • Boolean-eq
              • Field-div-checked
              • Field-inv-checked
              • Boolean-assert-neq
              • Boolean-assert-eq
              • Field-eq
              • Field-assert-neq
              • Field-assert-eq
              • Field-mul
              • Field-sub
              • Field-square
              • Field-neg
              • Field-double
              • Field-add
            • Language
          • Leo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Boolean-neq

    Boolean-neq-correctness

    Correctness of the circuit.

    We expand the boolean non-equality predicate to the boolean exclusive disjunction predicate, and we use its correctness theorem to rewrite it to its specification. We expand both specifications, which are equal.

    The extension to the circuit is boilerplate.

    Definitions and Theorems

    Theorem: boolean-neq-pred-to-spec

    (defthm boolean-neq-pred-to-spec
      (implies (and (primep prime)
                    (pfield::fep x prime)
                    (pfield::fep y prime)
                    (pfield::fep z prime)
                    (bitp x)
                    (bitp y))
               (equal (boolean-neq-pred x y z prime)
                      (boolean-neq-spec x y z prime))))

    Theorem: boolean-neq-circuit-to-spec

    (defthm boolean-neq-circuit-to-spec
      (implies
           (and (equal (pfcs::lookup-definition (pfname "boolean_neq")
                                                defs)
                       (boolean-neq-circuit))
                (equal (pfcs::lookup-definition (pfname "boolean_xor")
                                                defs)
                       (boolean-xor-circuit))
                (primep prime)
                (pfield::fep x prime)
                (pfield::fep y prime)
                (pfield::fep z prime)
                (bitp x)
                (bitp y))
           (equal (pfcs::definition-satp (pfname "boolean_neq")
                                         defs (list x y z)
                                         prime)
                  (boolean-neq-spec x y z prime))))