Recognizer for mapping structures.
(mappingp x) → *
Function:
(defun mappingp (x) (declare (xargs :guard t)) (let ((__function__ 'mappingp)) (declare (ignorable __function__)) (and (consp x) (eq (car x) :mapping) (mbe :logic (and (alistp (cdr x)) (equal (strip-cars (cdr x)) '(name key-name key-type value-name value-type))) :exec (fty::alist-with-carsp (cdr x) '(name key-name key-type value-name value-type))) (b* ((name (cdr (std::da-nth 0 (cdr x)))) (key-name (cdr (std::da-nth 1 (cdr x)))) (key-type (cdr (std::da-nth 2 (cdr x)))) (value-name (cdr (std::da-nth 3 (cdr x)))) (value-type (cdr (std::da-nth 4 (cdr x))))) (and (identifierp name) (identifierp key-name) (finalize-typep key-type) (identifierp value-name) (finalize-typep value-type))))))
Theorem:
(defthm consp-when-mappingp (implies (mappingp x) (consp x)) :rule-classes :compound-recognizer)