Function:
(defun lhs-rsh (sh x) (declare (xargs :guard (and (natp sh) (lhs-p x)))) (let ((__function__ 'lhs-rsh)) (declare (ignorable __function__)) (b* (((when (zp sh)) (lhs-fix x)) ((when (atom x)) nil) ((lhrange xf) (car x)) ((when (<= xf.w sh)) (lhs-rsh (- sh xf.w) (cdr x))) (newatom (lhatom-case xf.atom :z (lhatom-z) :var (lhatom-var xf.atom.name (+ xf.atom.rsh sh))))) (lhs-cons (lhrange (- xf.w sh) newatom) (cdr x)))))
Theorem:
(defthm lhs-p-of-lhs-rsh (b* ((rsh (lhs-rsh sh x))) (lhs-p rsh)) :rule-classes :rewrite)
Theorem:
(defthm lhs-rsh-of-nfix-sh (equal (lhs-rsh (nfix sh) x) (lhs-rsh sh x)))
Theorem:
(defthm lhs-rsh-nat-equiv-congruence-on-sh (implies (nat-equiv sh sh-equiv) (equal (lhs-rsh sh x) (lhs-rsh sh-equiv x))) :rule-classes :congruence)
Theorem:
(defthm lhs-rsh-of-lhs-fix-x (equal (lhs-rsh sh (lhs-fix x)) (lhs-rsh sh x)))
Theorem:
(defthm lhs-rsh-lhs-equiv-congruence-on-x (implies (lhs-equiv x x-equiv) (equal (lhs-rsh sh x) (lhs-rsh sh x-equiv))) :rule-classes :congruence)
Theorem:
(defthm lhs-rsh-correct (equal (lhs-eval (lhs-rsh sh x) env) (4vec-rsh (2vec (nfix sh)) (lhs-eval x env))))
Theorem:
(defthm lhs-rsh-correct-zero (equal (lhs-eval-zx (lhs-rsh sh x) env) (4vec-rsh (2vec (nfix sh)) (lhs-eval-zx x env))))
Theorem:
(defthm lhs-width-of-lhs-rsh (<= (lhs-width (lhs-rsh sh x)) (nfix (- (lhs-width x) (nfix sh)))) :rule-classes :linear)
Theorem:
(defthm lhs-rsh-of-lhs-cons (lhs-norm-equiv (lhs-rsh sh (lhs-cons x y)) (lhs-rsh sh (cons x y))))
Theorem:
(defthm lhs-rsh-of-lhs-norm-x-under-lhs-norm-equiv (lhs-norm-equiv (lhs-rsh sh (lhs-norm x)) (lhs-rsh sh x)))
Theorem:
(defthm lhs-rsh-lhs-norm-equiv-congruence-on-x-under-lhs-norm-equiv (implies (lhs-norm-equiv x x-equiv) (lhs-norm-equiv (lhs-rsh sh x) (lhs-rsh sh x-equiv))) :rule-classes :congruence)
Theorem:
(defthm len-of-lhs-rsh (<= (len (lhs-rsh sh x)) (len x)) :rule-classes :linear)