• 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-p

    Recognizer for command-error structures.

    Signature
    (command-error-p x) → *

    Definitions and Theorems

    Function: command-error-p

    (defun command-error-p (x)
     (declare (xargs :guard t))
     (let ((__function__ 'command-error-p))
      (declare (ignorable __function__))
      (and (consp x)
           (cond ((or (atom x)
                      (eq (car x) :malformed-mnemonic))
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((mnemonic (std::da-nth 0 (cdr x))))
                         (stringp mnemonic))))
                 ((eq (car x) :malformed-passphrase)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((passphrase (std::da-nth 0 (cdr x))))
                         (stringp passphrase))))
                 ((eq (car x) :malformed-entropy)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((entropy (std::da-nth 0 (cdr x))))
                         (stringp entropy))))
                 ((eq (car x) :malformed-nonce)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((nonce (std::da-nth 0 (cdr x))))
                         (stringp nonce))))
                 ((eq (car x) :malformed-gas-price)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((gas-price (std::da-nth 0 (cdr x))))
                         (stringp gas-price))))
                 ((eq (car x) :malformed-gas-limit)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((gas-limit (std::da-nth 0 (cdr x))))
                         (stringp gas-limit))))
                 ((eq (car x) :malformed-to)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((to (std::da-nth 0 (cdr x))))
                         (stringp to))))
                 ((eq (car x) :malformed-value)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((value (std::da-nth 0 (cdr x))))
                         (stringp value))))
                 ((eq (car x) :malformed-data)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((data (std::da-nth 0 (cdr x))))
                         (stringp data))))
                 ((eq (car x)
                      :malformed-address-key-index)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((address-key-index (std::da-nth 0 (cdr x))))
                         (stringp address-key-index))))
                 ((eq (car x)
                      :address-key-index-too-large)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 2)
                       (b* ((address-key-index (std::da-nth 0 (cdr x)))
                            (limit (std::da-nth 1 (cdr x))))
                         (and (natp address-key-index)
                              (natp limit)))))
                 ((eq (car x) :address-key-index-skipped)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((address-key-index (std::da-nth 0 (cdr x))))
                         (natp address-key-index))))
                 ((eq (car x) :root-key-derivation-fail)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 0)
                       (b* nil t)))
                 ((eq (car x)
                      :purpose-key-derivation-fail)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 0)
                       (b* nil t)))
                 ((eq (car x)
                      :coin-type-key-derivation-fail)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 0)
                       (b* nil t)))
                 ((eq (car x)
                      :account-key-derivation-fail)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 0)
                       (b* nil t)))
                 ((eq (car x)
                      :external-chain-key-derivation-fail)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 0)
                       (b* nil t)))
                 ((eq (car x)
                      :address-key-derivation-fail)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((address-key-index (std::da-nth 0 (cdr x))))
                         (natp address-key-index))))
                 ((eq (car x) :address-key-index-limit)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 0)
                       (b* nil t)))
                 ((eq (car x) :pretransaction-rlp-fail)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 0)
                       (b* nil t)))
                 ((eq (car x) :transaction-sign-fail)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 0)
                       (b* nil t)))
                 ((eq (car x) :transaction-rlp-fail)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 0)
                       (b* nil t)))
                 ((eq (car x) :state-file-untestable)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 0)
                       (b* nil t)))
                 ((eq (car x) :state-file-absent)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 0)
                       (b* nil t)))
                 ((eq (car x) :state-file-present)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 0)
                       (b* nil t)))
                 ((eq (car x) :state-file-not-regular)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 0)
                       (b* nil t)))
                 ((eq (car x) :state-file-malformed)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 0)
                       (b* nil t)))
                 ((eq (car x) :wrong-number-of-arguments)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 2)
                       (b* ((required (std::da-nth 0 (cdr x)))
                            (given (std::da-nth 1 (cdr x))))
                         (and (natp required) (natp given)))))
                 ((eq (car x) :wrong-command)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((command (std::da-nth 0 (cdr x))))
                         (stringp command))))
                 (t (and (eq (car x) :no-command)
                         (and (true-listp (cdr x))
                              (eql (len (cdr x)) 0))
                         (b* nil t)))))))

    Theorem: consp-when-command-error-p

    (defthm consp-when-command-error-p
      (implies (command-error-p x) (consp x))
      :rule-classes :compound-recognizer)