Associative list in Prolog
问题 i m doing associative list in prolog i seen this topic but i dont understand the code. Associative Lists in Prolog For checking list is associative isn't enough do this: lists([_X, _Y]). lists([[H|_T]|L],[H|T]):- lists(L,T). Because for first /1 i check if have element in this way [a,3] and /2 take list of list [[a,4],[a,3]] in this way. so first pass call list/2 on [a,3], and check true for base case, and after call [a,4] and call true for base case too. I wrong something, but i don't see,