Theorems |
foldl_append : !f b l1 l2. foldl f b (APPEND l1 l2) = foldl f (foldl f b l1) l2foldl_append_assoc : !g f b l1 l2.
(!s. g s b = s) /\ (!s1 s2 x. g s1 (f s2 x) = f (g s1 s2) x)
==> foldl f b (APPEND l1 l2) = g (foldl f b l1) (foldl f b l2)foldl_cons : !f b h t. foldl f b (CONS h t) = foldl f (f b h) tfoldl_nil : !f b. foldl f b [] = bfoldl_reverse : !f b l. foldl f b (REVERSE l) = foldr (C f) b lfoldl_suc : !l k. foldl (\n x. SUC n) k l = LENGTH l + kfoldl_with_cons : !l1 l2. foldl (C CONS) l2 l1 = APPEND (REVERSE l1) l2foldl_with_cons_nil : !l. foldl (C CONS) [] l = REVERSE lfoldr_append : !f b l1 l2. foldr f b (APPEND l1 l2) = foldr f (foldr f b l2) l1foldr_append_assoc : !g f b l1 l2.
(!s. g b s = s) /\ (!x s1 s2. g (f x s1) s2 = f x (g s1 s2))
==> foldr f b (APPEND l1 l2) = g (foldr f b l1) (foldr f b l2)foldr_reverse : !f b l. foldr f b (REVERSE l) = foldl (C f) b lfoldr_suc : !l k. foldr (\x n. SUC n) k l = LENGTH l + kfoldr_with_cons : !l1 l2. foldr CONS l2 l1 = APPEND l1 l2foldr_with_cons_nil : !l. foldr CONS [] l = l |