(merge-jfields fields1 fields2) → merged-fields
Function:
(defun merge-jfields (fields1 fields2) (declare (xargs :guard (and (jfield-listp fields1) (jfield-listp fields2)))) (let ((__function__ 'merge-jfields)) (declare (ignorable __function__)) (cond ((endp fields1) fields2) ((endp fields2) fields1) (t (if (string<= (jfield->name (car fields1)) (jfield->name (car fields2))) (cons (car fields1) (merge-jfields (cdr fields1) fields2)) (cons (car fields2) (merge-jfields fields1 (cdr fields2))))))))
Theorem:
(defthm jfield-listp-of-merge-jfields (implies (and (jfield-listp fields1) (jfield-listp fields2)) (b* ((merged-fields (merge-jfields fields1 fields2))) (jfield-listp merged-fields))) :rule-classes :rewrite)