Many-valued logic processor for data query systems