Retrieve, from a set of proposals, the subset of proposals with a given author and round.
(props-with-author+round author round props) → props-with-author+round
Function:
(defun props-with-author+round (author round props) (declare (xargs :guard (and (addressp author) (posp round) (proposal-setp props)))) (let ((__function__ 'props-with-author+round)) (declare (ignorable __function__)) (b* (((when (emptyp (proposal-set-fix props))) nil) ((proposal prop) (head props))) (if (and (equal (address-fix author) prop.author) (equal (pos-fix round) prop.round)) (insert (proposal-fix prop) (props-with-author+round author round (tail props))) (props-with-author+round author round (tail props))))))
Theorem:
(defthm proposal-setp-of-props-with-author+round (b* ((props-with-author+round (props-with-author+round author round props))) (proposal-setp props-with-author+round)) :rule-classes :rewrite)
Theorem:
(defthm props-with-author+round-subset (implies (proposal-setp props) (b* ((?props-with-author+round (props-with-author+round author round props))) (subset props-with-author+round props))))
Theorem:
(defthm props-with-author+round-of-nil (equal (props-with-author+round author round nil) nil))
Theorem:
(defthm in-of-props-with-author+round (equal (in prop (props-with-author+round author round props)) (and (in prop (proposal-set-fix props)) (equal (proposal->author prop) (address-fix author)) (equal (proposal->round prop) (pos-fix round)))))
Theorem:
(defthm props-with-author+round-of-address-fix-author (equal (props-with-author+round (address-fix author) round props) (props-with-author+round author round props)))
Theorem:
(defthm props-with-author+round-address-equiv-congruence-on-author (implies (address-equiv author author-equiv) (equal (props-with-author+round author round props) (props-with-author+round author-equiv round props))) :rule-classes :congruence)
Theorem:
(defthm props-with-author+round-of-pos-fix-round (equal (props-with-author+round author (pos-fix round) props) (props-with-author+round author round props)))
Theorem:
(defthm props-with-author+round-pos-equiv-congruence-on-round (implies (acl2::pos-equiv round round-equiv) (equal (props-with-author+round author round props) (props-with-author+round author round-equiv props))) :rule-classes :congruence)
Theorem:
(defthm props-with-author+round-of-proposal-set-fix-props (equal (props-with-author+round author round (proposal-set-fix props)) (props-with-author+round author round props)))
Theorem:
(defthm props-with-author+round-proposal-set-equiv-congruence-on-props (implies (proposal-set-equiv props props-equiv) (equal (props-with-author+round author round props) (props-with-author+round author round props-equiv))) :rule-classes :congruence)