• Top
  • Address

Addressp

Recognizer for address structures.

Signature
(addressp x) → *

Definitions and Theorems

Function: addressp

(defun addressp (x)
  (declare (xargs :guard t))
  (let ((__function__ 'addressp))
    (declare (ignorable __function__))
    (and (consp x)
         (eq (car x) :address)
         (mbe :logic (and (alistp (cdr x))
                          (equal (strip-cars (cdr x)) '(name)))
              :exec (fty::alist-with-carsp (cdr x) '(name)))
         (b* ((name (cdr (std::da-nth 0 (cdr x)))))
           (and (stringp name)
                (address-string-p name))))))

Theorem: consp-when-addressp

(defthm consp-when-addressp
  (implies (addressp x) (consp x))
  :rule-classes :compound-recognizer)