Skip to content

Instantly share code, notes, and snippets.

@dbellettini
Created December 18, 2015 13:29
Show Gist options
  • Save dbellettini/30ed8e8482582a3bb2a9 to your computer and use it in GitHub Desktop.
Save dbellettini/30ed8e8482582a3bb2a9 to your computer and use it in GitHub Desktop.
katalist(X, X, equal) :- !.
katalist(X, Y, sublist) :- sublist(X, Y), !.
katalist(X, Y, superlist) :- sublist(Y, X), !.
katalist(_, _, unequal) :- !.
prefix(X, L) :- append(X, _, L).
suffix(X, L) :- append(_, X, L).
sublist(X, L) :- suffix(S, L), prefix(X, S).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment