Due Mon, 19 Mar @ 5:00 PM
Using an accumulator-style definition of product, prove (in ACL2):
(product (append xs ys)) = (* (product xs) (product ys))Use accumulator-style to develop a program largest that produces the biggest number in a non-empty list of numbers. Prove (in ACL2) that the result it delivers is
larger than or equal to all of the members of the list, and
contained in the list.
For the second theorem, you'll probably need to prevent ACL2 from using the definition of the membership predicate. To do that, use a hint like:
(defthm Theorem-2
... the-theorem ...
:hints (("Goal" :in-theory (disable member-equal))))
Develop an accumulator-style reverse; call it rev so you don't collide with the built-in reverse.
Prove that (rev (rev xs)) = xs for xs:List[Any].
Convince ACL2 that quick sort is equivalent to insertion sort.