Recognizer for alists whose keys are strings.
Function:
(defun vl-string-keys-p (x) (declare (xargs :guard t)) (if (consp x) (and (consp (car x)) (stringp (caar x)) (vl-string-keys-p (cdr x))) (not x)))
Theorem:
(defthm vl-string-keys-p-when-not-consp (implies (not (consp x)) (equal (vl-string-keys-p x) (not x))))
Theorem:
(defthm vl-string-keys-p-of-cons (equal (vl-string-keys-p (cons a x)) (and (consp a) (stringp (car a)) (vl-string-keys-p x))))
Theorem:
(defthm vl-string-keys-p-of-hons-shrink-alist (implies (and (vl-string-keys-p x) (vl-string-keys-p ans)) (vl-string-keys-p (hons-shrink-alist x ans))))
Theorem:
(defthm string-listp-of-strip-cars-when-vl-string-keys-p (implies (vl-string-keys-p x) (string-listp (strip-cars x))))
Theorem:
(defthm vl-string-keys-p-of-make-lookup-alist (equal (vl-string-keys-p (make-lookup-alist x)) (string-listp (list-fix x))))