Integer division as in truncate for 4vecs.
This is a fairly conservative definition in the style of the
Verilog semantics: if either input has X or Z bits, or if you try to divide by
zero, then the result is all X bits. Otherwise, we produce the integer
division of
Function:
(defun 4vec-quotient (x y) (declare (xargs :guard (and (4vec-p x) (4vec-p y)))) (let ((__function__ '4vec-quotient)) (declare (ignorable __function__)) (if (and (2vec-p x) (2vec-p y) (not (eql (2vec->val y) 0))) (2vec (truncate (the integer (2vec->val x)) (the integer (2vec->val y)))) (4vec-x))))
Theorem:
(defthm 4vec-p-of-4vec-quotient (b* ((quotient (4vec-quotient x y))) (4vec-p quotient)) :rule-classes :rewrite)
Theorem:
(defthm 4vec-quotient-of-2vecx-fix-x (equal (4vec-quotient (2vecx-fix x) y) (4vec-quotient x y)))
Theorem:
(defthm 4vec-quotient-2vecx-equiv-congruence-on-x (implies (2vecx-equiv x x-equiv) (equal (4vec-quotient x y) (4vec-quotient x-equiv y))) :rule-classes :congruence)
Theorem:
(defthm 4vec-quotient-of-2vecx-fix-y (equal (4vec-quotient x (2vecx-fix y)) (4vec-quotient x y)))
Theorem:
(defthm 4vec-quotient-2vecx-equiv-congruence-on-y (implies (2vecx-equiv y y-equiv) (equal (4vec-quotient x y) (4vec-quotient x y-equiv))) :rule-classes :congruence)