Equating a Sublist to Another Sublist for CYK table in Prolog
问题 I'm currently working on a Prolog program that will generate a CYK parse table after being given a set of productions. However, I am having troubles checking two rows to see if they are equivalent. Here's what I have so far: answer(X,X). %Checks to see if it is equivalent equal(X,Y) :- sort(X,X1), sort(Y,Y1), X1 == Y1. %find the length of the lists total_length([],0). total_length([_|Xs],L) :- total_length(Xs,M), L is M+1. %storing length of lists and possible use of a decrement here to