assignment-11

assignment-11 - Hint You will find it useful to use the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Assignment #11 CSC301 –Fall 2010 - Due Friday 11/12 in class Define a predicate myflip/2 whose arguments are both lists, the second being the reverse of the first. For example, myflip([a,b,c],X) should give X=[c,b,a]. Test your predicate with the following queries: ?- myflip([a,b,c,d,e,f],X). ?- myflip([a1,a2,a3,a4],X).
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Hint : You will find it useful to use the append/3 predicate covered in class. The append/3 predicate is a built-in predicate in Prolog, so no need to type in the rules. Do not use the built-in predicate reverse to implement the myflip predicate. Please submit a copy of your source code and evidence that your program runs....
View Full Document

This note was uploaded on 10/03/2011 for the course CSC 301 taught by Professor Hamel during the Spring '08 term at Rhode Island.

Ask a homework question - tutors are online