Pretty print a
(vl-pp-define name x &key (ps 'ps)) → ps
Function:
(defun vl-pp-define-fn (name x ps) (declare (xargs :stobjs (ps))) (declare (xargs :guard (and (stringp name) (vl-maybe-define-p x)))) (let ((__function__ 'vl-pp-define)) (declare (ignorable __function__)) (if x (b* (((vl-define x))) (vl-ps-seq (vl-print "`define ") (vl-print-str (vl-maybe-escape-identifier name)) (vl-print " ") (if (not x.formals) ps (vl-ps-seq (vl-print "(") (vl-pp-define-formals x.formals) (vl-print ") "))) (vl-print-str x.body) (vl-println ""))) (vl-ps-seq (vl-print "`undef ") (vl-print-str (vl-maybe-escape-identifier name)) (vl-println "")))))
Theorem:
(defthm vl-pp-define-fn-of-str-fix-name (equal (vl-pp-define-fn (str-fix name) x ps) (vl-pp-define-fn name x ps)))
Theorem:
(defthm vl-pp-define-fn-streqv-congruence-on-name (implies (streqv name name-equiv) (equal (vl-pp-define-fn name x ps) (vl-pp-define-fn name-equiv x ps))) :rule-classes :congruence)
Theorem:
(defthm vl-pp-define-fn-of-vl-maybe-define-fix-x (equal (vl-pp-define-fn name (vl-maybe-define-fix x) ps) (vl-pp-define-fn name x ps)))
Theorem:
(defthm vl-pp-define-fn-vl-maybe-define-equiv-congruence-on-x (implies (vl-maybe-define-equiv x x-equiv) (equal (vl-pp-define-fn name x ps) (vl-pp-define-fn name x-equiv ps))) :rule-classes :congruence)