• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
          • Command-error
            • Command-error-p
            • Command-error-fix
            • Command-error-case
            • Command-error-kind
              • Command-error-equiv
              • Command-error-wrong-number-of-arguments
              • Command-error-address-key-index-too-large
              • Command-error-wrong-command
              • Command-error-malformed-value
              • Command-error-malformed-to
              • Command-error-malformed-passphrase
              • Command-error-malformed-nonce
              • Command-error-malformed-mnemonic
              • Command-error-malformed-gas-price
              • Command-error-malformed-gas-limit
              • Command-error-malformed-entropy
              • Command-error-malformed-data
              • Command-error-malformed-address-key-index
              • Command-error-address-key-index-skipped
              • Command-error-address-key-derivation-fail
              • Command-error-transaction-sign-fail
              • Command-error-transaction-rlp-fail
              • Command-error-state-file-untestable
              • Command-error-state-file-present
              • Command-error-state-file-not-regular
              • Command-error-state-file-malformed
              • Command-error-state-file-absent
              • Command-error-root-key-derivation-fail
              • Command-error-purpose-key-derivation-fail
              • Command-error-pretransaction-rlp-fail
              • Command-error-no-command
              • Command-error-external-chain-key-derivation-fail
              • Command-error-coin-type-key-derivation-fail
              • Command-error-address-key-index-limit
              • Command-error-account-key-derivation-fail
            • Sign
            • Init-from-mnemonic
            • Command-error-message
            • Stat
            • Next-key
            • Init-from-entropy
            • Process-command
            • Transaction-message
            • Maybe-command-error
            • Maybe-stat
            • Check-stat-file-present
            • Valid-key-path-p
            • String-to-byte-list
            • Load-stat
            • Mnemonic-message
            • Process-sign
            • Process-init-from-entropy
            • All-valid-key-paths-p
            • String-to-word
            • String-to-nat
            • Process-next-key
            • Wallet
            • Process-init-from-mnemonic
            • Check-stat-file-absent
            • Stat-wfp
            • Save-stat
            • Stat-addresses-bounded-p
            • Stat-all-valid-key-paths-p
            • Stat-priv-keys-p
            • Stat-root-depth-zero-p
            • Stat-path-prefix-in-tree-p
            • Crypto-hdwallet-executable
            • *stat-filepath*
            • *key-path-prefix*
            • *coin-type-index*
            • *purpose-index*
            • *external-chain-index*
            • *command-name-init-from-mnemonic*
            • *command-name-init-from-entropy*
            • *account-index*
            • *command-name-sign*
            • *command-name-next-key*
          • Apt
          • Error-checking
          • Fty-extensions
          • Isar
          • Kestrel-utilities
          • Set
          • Soft
          • C
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • 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
    • Command-error

    Command-error-kind

    Get the kind (tag) of a command-error structure.

    Signature
    (command-error-kind x) → kind
    Arguments
    x — Guard (command-error-p x).

    Definitions and Theorems

    Function: command-error-kind$inline

    (defun command-error-kind$inline (x)
      (declare (xargs :guard (command-error-p x)))
      (let ((__function__ 'command-error-kind))
        (declare (ignorable __function__))
        (mbe :logic (cond ((or (atom x)
                               (eq (car x) :malformed-mnemonic))
                           :malformed-mnemonic)
                          ((eq (car x) :malformed-passphrase)
                           :malformed-passphrase)
                          ((eq (car x) :malformed-entropy)
                           :malformed-entropy)
                          ((eq (car x) :malformed-nonce)
                           :malformed-nonce)
                          ((eq (car x) :malformed-gas-price)
                           :malformed-gas-price)
                          ((eq (car x) :malformed-gas-limit)
                           :malformed-gas-limit)
                          ((eq (car x) :malformed-to)
                           :malformed-to)
                          ((eq (car x) :malformed-value)
                           :malformed-value)
                          ((eq (car x) :malformed-data)
                           :malformed-data)
                          ((eq (car x)
                               :malformed-address-key-index)
                           :malformed-address-key-index)
                          ((eq (car x)
                               :address-key-index-too-large)
                           :address-key-index-too-large)
                          ((eq (car x) :address-key-index-skipped)
                           :address-key-index-skipped)
                          ((eq (car x) :root-key-derivation-fail)
                           :root-key-derivation-fail)
                          ((eq (car x)
                               :purpose-key-derivation-fail)
                           :purpose-key-derivation-fail)
                          ((eq (car x)
                               :coin-type-key-derivation-fail)
                           :coin-type-key-derivation-fail)
                          ((eq (car x)
                               :account-key-derivation-fail)
                           :account-key-derivation-fail)
                          ((eq (car x)
                               :external-chain-key-derivation-fail)
                           :external-chain-key-derivation-fail)
                          ((eq (car x)
                               :address-key-derivation-fail)
                           :address-key-derivation-fail)
                          ((eq (car x) :address-key-index-limit)
                           :address-key-index-limit)
                          ((eq (car x) :pretransaction-rlp-fail)
                           :pretransaction-rlp-fail)
                          ((eq (car x) :transaction-sign-fail)
                           :transaction-sign-fail)
                          ((eq (car x) :transaction-rlp-fail)
                           :transaction-rlp-fail)
                          ((eq (car x) :state-file-untestable)
                           :state-file-untestable)
                          ((eq (car x) :state-file-absent)
                           :state-file-absent)
                          ((eq (car x) :state-file-present)
                           :state-file-present)
                          ((eq (car x) :state-file-not-regular)
                           :state-file-not-regular)
                          ((eq (car x) :state-file-malformed)
                           :state-file-malformed)
                          ((eq (car x) :wrong-number-of-arguments)
                           :wrong-number-of-arguments)
                          ((eq (car x) :wrong-command)
                           :wrong-command)
                          (t :no-command))
             :exec (car x))))

    Theorem: command-error-kind-possibilities

    (defthm command-error-kind-possibilities
      (or (equal (command-error-kind x)
                 :malformed-mnemonic)
          (equal (command-error-kind x)
                 :malformed-passphrase)
          (equal (command-error-kind x)
                 :malformed-entropy)
          (equal (command-error-kind x)
                 :malformed-nonce)
          (equal (command-error-kind x)
                 :malformed-gas-price)
          (equal (command-error-kind x)
                 :malformed-gas-limit)
          (equal (command-error-kind x)
                 :malformed-to)
          (equal (command-error-kind x)
                 :malformed-value)
          (equal (command-error-kind x)
                 :malformed-data)
          (equal (command-error-kind x)
                 :malformed-address-key-index)
          (equal (command-error-kind x)
                 :address-key-index-too-large)
          (equal (command-error-kind x)
                 :address-key-index-skipped)
          (equal (command-error-kind x)
                 :root-key-derivation-fail)
          (equal (command-error-kind x)
                 :purpose-key-derivation-fail)
          (equal (command-error-kind x)
                 :coin-type-key-derivation-fail)
          (equal (command-error-kind x)
                 :account-key-derivation-fail)
          (equal (command-error-kind x)
                 :external-chain-key-derivation-fail)
          (equal (command-error-kind x)
                 :address-key-derivation-fail)
          (equal (command-error-kind x)
                 :address-key-index-limit)
          (equal (command-error-kind x)
                 :pretransaction-rlp-fail)
          (equal (command-error-kind x)
                 :transaction-sign-fail)
          (equal (command-error-kind x)
                 :transaction-rlp-fail)
          (equal (command-error-kind x)
                 :state-file-untestable)
          (equal (command-error-kind x)
                 :state-file-absent)
          (equal (command-error-kind x)
                 :state-file-present)
          (equal (command-error-kind x)
                 :state-file-not-regular)
          (equal (command-error-kind x)
                 :state-file-malformed)
          (equal (command-error-kind x)
                 :wrong-number-of-arguments)
          (equal (command-error-kind x)
                 :wrong-command)
          (equal (command-error-kind x)
                 :no-command))
      :rule-classes
      ((:forward-chaining :trigger-terms ((command-error-kind x)))))