Normalize a load configuration to avoid, e.g., redundant search paths and extensions.
(vl-loadconfig-clean config) → new-config
We clean up the load configuration in a couple of ways. This is partially an optimization that will help us to avoid looking in the same directories multiple times. It also helps to prevent spurious "ambiguous load" warnings that could arise if someone gives the same search extensions multiple times.
Function:
(defun vl-loadconfig-clean (config) (declare (xargs :guard (vl-loadconfig-p config))) (let ((__function__ 'vl-loadconfig-clean)) (declare (ignorable __function__)) (b* (((vl-loadconfig config))) (change-vl-loadconfig config :start-names (mergesort config.start-names) :search-path (remove-duplicates-equal config.search-path) :search-exts (vl-clean-search-extensions config.search-exts) :include-dirs (remove-duplicates-equal config.include-dirs)))))
Theorem:
(defthm vl-loadconfig-p-of-vl-loadconfig-clean (b* ((new-config (vl-loadconfig-clean config))) (vl-loadconfig-p new-config)) :rule-classes :rewrite)