• Top
  • File

Filep

Recognizer for file structures.

Signature
(filep x) → *

Definitions and Theorems

Function: filep

(defun filep (x)
  (declare (xargs :guard t))
  (let ((__function__ 'filep))
    (declare (ignorable __function__))
    (and (mbe :logic (and (alistp x)
                          (equal (strip-cars x)
                                 '(imports program)))
              :exec (fty::alist-with-carsp x '(imports program)))
         (b* ((imports (cdr (std::da-nth 0 x)))
              (program (cdr (std::da-nth 1 x))))
           (and (importdecl-listp imports)
                (programdeclp program))))))

Theorem: consp-when-filep

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