Advertisement
samham1218

prolog questions

Dec 6th, 2018
772
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. 1. Write a predicate lists to return the list elements of a given list (use atomic)
  2. EX: lists ([1, [2,3], [4], 5], X). ---> X=[[2,3],[4]]
  3.  
  4. 2. Write a pedicate perm to list all permutations of a given number n
  5. EX: perm(3,X). ---> [[1,2,3],[2,1,3],[2,3,1],[1,3,2],[3,1,2],[3,2,1]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement