<> (tally ?value (Bag ?list)) ((Bag tallying| tallying> ?value ?list)) <> (tallying> ?value ()) ( (tallying> ?value ((Entry ?value ?count) ?rest)) ( (tallying> ?value (?entry ?rest)) ((?entry tallying> ?value ?rest)) <> ((Bag tallying| ((?entry (find ?value (Bag ?list)) ((Bag find| find> ?value ?list)) <> (find> ?value ((Entry ?value ?count) ?rest)) ( (find> ?value ()) ( (find> ?value (?entry ?rest)) ((?entry find> ?value ?rest)) <> ((Bag find| ((?entry (has all ()) (#yes) <> (has all (?item ?rest)) (?rest has all| find ?item) <> (?rest has all| #yes) (has all ?rest) <> (?rest has all| #no) (#no) <> (bag {) (bag) <> (bag }) ((Bag ())) <> (bag ?item) (tally ?item bag) has all (flour (sugar (apples ()))) bag { sugar oranges apples cherries flour apples }