I am new to prolog and I am trying to create a simple predicate which will have sorted list of lists from a unsorted list of lists. check(A,B).
check( [ [], [1], [1,1] ], [ [], [1,1], [1] ] ). returns true
check( [ [], [1], [1,1] ], [ [1,1], [1] ] ). returns false.
Note that even if A is sorted it should only contain elements from B and not anything more or less.
How do I implement this without any built in prolog predicates?
sort([[],[1],[1,1]], X)
I getX = [[], [1], [1, 1]]
(not[[],[1,1],[1]]
). - Wouter Beek