(extend-internal-paths a x) constructs a new list where
This is used to extend a list of paths with a new level of the
module hierarchy. That is, suppose
(list (hons a x1) (hons a x2) ... (hons a xn))
which can loosely be thought of as,
Function:
(defun extend-internal-paths-exec (a x acc) (declare (xargs :guard t)) (if (atom x) acc (let ((acc (cons (hons a (car x)) acc))) (extend-internal-paths-exec a (cdr x) acc))))
Function:
(defun extend-internal-paths-exec-cons (a x acc) (declare (xargs :guard t)) (mbe :logic (extend-internal-paths-exec a x acc) :exec (if (atom x) acc (let ((acc (cons (cons a (car x)) acc))) (extend-internal-paths-exec-cons a (cdr x) acc)))))
Function:
(defun extend-internal-paths (a x) (declare (xargs :guard t)) (mbe :logic (if (atom x) nil (cons (hons a (car x)) (extend-internal-paths a (cdr x)))) :exec (reverse (extend-internal-paths-exec a x nil))))
Theorem:
(defthm extend-internal-paths-exec-removal (equal (extend-internal-paths-exec a x acc) (revappend (extend-internal-paths a x) acc)))
Function:
(defun extend-internal-paths-cons (a x) (declare (xargs :guard t)) (mbe :logic (extend-internal-paths a x) :exec (reverse (extend-internal-paths-exec-cons a x nil))))
Theorem:
(defthm cons-listp-of-extend-internal-paths (cons-listp (extend-internal-paths a x)))
Theorem:
(defthm len-extend-internal-paths (equal (len (extend-internal-paths u lst)) (len lst)))