Beyond bloom filters: from approximate membership checks to approximate state machines