• 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
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • Aleo
        • Aleobft
        • Aleovm
          • Circuits
          • Language
            • Grammar
            • Early-version
              • Abstract-syntax
                • Binary-op
                • Literal
                • Instruction
                • Hash-op
                • Literal-type
                • Operand
                • Unary-op
                • Identifier
                • Commit-op
                • Mapping
                • Function
                • Programdef
                • Finalize-type
                • Closure
                • Register-type
                • Finalizer
                • Value-type
                • Record-type
                • Command
                • Plaintext-type
                • Finalization-option
                • Visibility
                • Register
                • Reference
                • Programid
                • Locator
                • Finalization
                • Entry-type
                • Regaccess
                • Program
                • Interface-type
                • Ident+ptype
                • Ident+etype
                • Function-output
                • Finalize-output
                • Finalize-input
                • Closure-output
                • Closure-input
                • Assert-op
                • Function-input
                • Equal-op
                • Finalize-command
                • Ternary-op
                  • Ternary-op-case
                  • Ternary-op-fix
                    • Ternary-op-equiv
                    • Ternary-opp
                    • Ternary-op-ternary
                    • Ternary-op-kind
                  • Import
                  • Ident+ptype-list
                  • Operand-list
                  • Ident+etype-list
                  • Programdef-list
                  • Instruction-list
                  • Import-list
                  • Identifier-list
                  • Function-output-list
                  • Function-input-list
                  • Finalize-output-list
                  • Finalize-input-list
                  • Command-list
                  • Closure-output-list
                  • Closure-input-list
                • Parser
                • Concrete-syntax
              • Concrete-syntax
          • Leo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Ternary-op

    Ternary-op-fix

    Fixing function for ternary-op structures.

    Signature
    (ternary-op-fix x) → new-x
    Arguments
    x — Guard (ternary-opp x).
    Returns
    new-x — Type (ternary-opp new-x).

    Definitions and Theorems

    Function: ternary-op-fix$inline

    (defun ternary-op-fix$inline (x)
      (declare (xargs :guard (ternary-opp x)))
      (let ((__function__ 'ternary-op-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (case (ternary-op-kind x)
               (:ternary (cons :ternary (list))))
             :exec x)))

    Theorem: ternary-opp-of-ternary-op-fix

    (defthm ternary-opp-of-ternary-op-fix
      (b* ((new-x (ternary-op-fix$inline x)))
        (ternary-opp new-x))
      :rule-classes :rewrite)

    Theorem: ternary-op-fix-when-ternary-opp

    (defthm ternary-op-fix-when-ternary-opp
      (implies (ternary-opp x)
               (equal (ternary-op-fix x) x)))

    Function: ternary-op-equiv$inline

    (defun ternary-op-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (ternary-opp acl2::x)
                                  (ternary-opp acl2::y))))
      (equal (ternary-op-fix acl2::x)
             (ternary-op-fix acl2::y)))

    Theorem: ternary-op-equiv-is-an-equivalence

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

    Theorem: ternary-op-equiv-implies-equal-ternary-op-fix-1

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

    Theorem: ternary-op-fix-under-ternary-op-equiv

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

    Theorem: equal-of-ternary-op-fix-1-forward-to-ternary-op-equiv

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

    Theorem: equal-of-ternary-op-fix-2-forward-to-ternary-op-equiv

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

    Theorem: ternary-op-equiv-of-ternary-op-fix-1-forward

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

    Theorem: ternary-op-equiv-of-ternary-op-fix-2-forward

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

    Theorem: ternary-op-kind$inline-of-ternary-op-fix-x

    (defthm ternary-op-kind$inline-of-ternary-op-fix-x
      (equal (ternary-op-kind$inline (ternary-op-fix x))
             (ternary-op-kind$inline x)))

    Theorem: ternary-op-kind$inline-ternary-op-equiv-congruence-on-x

    (defthm ternary-op-kind$inline-ternary-op-equiv-congruence-on-x
      (implies (ternary-op-equiv x x-equiv)
               (equal (ternary-op-kind$inline x)
                      (ternary-op-kind$inline x-equiv)))
      :rule-classes :congruence)

    Theorem: consp-of-ternary-op-fix

    (defthm consp-of-ternary-op-fix
      (consp (ternary-op-fix x))
      :rule-classes :type-prescription)