Cause an error if a symbol is the same as another symbol.
(ensure-symbol-different symb symb1 description1 description error-erp error-val ctx state) → (mv erp val state)
Function:
(defun ensure-symbol-different (symb symb1 description1 description error-erp error-val ctx state) (declare (xargs :stobjs (state))) (declare (xargs :guard (and (symbolp symb) (symbolp symb1) (msgp description1) (msgp description)))) (b* (((when (eq symb symb1)) (er-soft+ ctx error-erp error-val "~@0 must be different from ~@1." description description1))) (value nil)))
Theorem:
(defthm return-type-of-ensure-symbol-different.erp (b* (((mv ?erp ?val ?state) (ensure-symbol-different symb symb1 description1 description error-erp error-val ctx state))) (implies erp (equal erp error-erp))) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-ensure-symbol-different.val (b* (((mv ?erp ?val ?state) (ensure-symbol-different symb symb1 description1 description error-erp error-val ctx state))) (and (implies erp (equal val error-val)) (implies (and (not erp) error-erp) (not val)))) :rule-classes :rewrite)