Blame | Last modification | View Log | RSS feed
irasnyd@duallie prolog $ cat inc.pl% Written By: Ira Snyder% Due Date: 03-09-2005% Homework #: 14 (Exercise #22)diff_one(0,1).diff_one(X,Y) :- diff_one(A,B), X is A+1, Y is B+1.inc([],[]).inc([H1|T1],[H2|T2]) :- diff_one(H1,H2), inc(T1,T2).irasnyd@duallie prolog $ plWelcome to SWI-Prolog (Multi-threaded, Version 5.1.13)Copyright (c) 1990-2003 University of Amsterdam.SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,and you are welcome to redistribute it under certain conditions.Please visit http://www.swi-prolog.org for details.For help, use ?- help(Topic). or ?- apropos(Word).?- [inc].% inc compiled 0.00 sec, 1,272 bytesYes?- inc([1,7,5],[2,8,6]).Yes?- inc([1,7,5],X).X = [2, 8, 6]Yes?- inc([],X).X = []Yes?- inc(X,[2,8,6]).X = [1, 7, 5]Yes?-% haltirasnyd@duallie prolog $