What is the purpose of the occur-check in the unification algorithm?
Write a logic program for sorting a list of numbers (in ascending order)
using the insertion sort algorithm.
For this, you will need to define:
– a predicate sort such that sort(L,L’) holds if L’ is a list containing
the same elements as L but in ascending order; and
– a predicate insertion such that insertion(X,L,L’) holds if X is a
number, L is a sorted list (in ascending order), and L’ is the result of
inserting X in the corresponding place in the list L.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here