(longest-common-prefix-list x) returns the longest list,
(longest-common-prefix-list x) → *
See also longest-common-prefix.
Function:
(defun longest-common-prefix-list (x) (declare (xargs :guard t)) (let ((__function__ 'longest-common-prefix-list)) (declare (ignorable __function__)) (cond ((atom x) nil) ((atom (cdr x)) (list-fix (car x))) (t (longest-common-prefix (first x) (longest-common-prefix-list (cdr x)))))))
Theorem:
(defthm true-listp-of-longest-common-prefix-list (true-listp (longest-common-prefix-list x)) :rule-classes :type-prescription)
Theorem:
(defthm string-listp-of-longest-common-prefix-list (implies (string-list-listp x) (string-listp (longest-common-prefix-list x))))
Theorem:
(defthm longest-common-prefix-list-of-list-fix (equal (longest-common-prefix-list (list-fix x)) (longest-common-prefix-list x)))
Theorem:
(defthm prefix-of-eachp-of-longest-common-prefix-list (prefix-of-eachp (longest-common-prefix-list x) x))