A Content Addressable Distributed Logic Memory with Applications to Information Retrieval