Map a constant to a constant in the language definition.
Function:
(defun ldm-const (const) (declare (xargs :guard (constp const))) (let ((__function__ 'ldm-const)) (declare (ignorable __function__)) (b* (((reterr) (c::const-enum (c::ident "irrelevant")))) (const-case const :int (retok (c::const-int (ldm-iconst const.unwrap))) :float (reterr (msg "Unsupported floating constant ~x0." const.unwrap)) :enum (b* (((erp ident1) (ldm-ident const.unwrap))) (retok (c::const-enum ident1))) :char (reterr (msg "Unsupported character constant ~x0." const.unwrap))))))
Theorem:
(defthm constp-of-ldm-const.const1 (b* (((mv acl2::?erp ?const1) (ldm-const const))) (c::constp const1)) :rule-classes :rewrite)
Theorem:
(defthm ldm-const-of-const-fix-const (equal (ldm-const (const-fix const)) (ldm-const const)))
Theorem:
(defthm ldm-const-const-equiv-congruence-on-const (implies (const-equiv const const-equiv) (equal (ldm-const const) (ldm-const const-equiv))) :rule-classes :congruence)