Declarative data structures for Prolog