Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!brunix!mj From: mj@cs.brown.edu (Mark Johnson) Newsgroups: comp.lang.prolog Subject: Re: A Challenge Message-ID: <23028@brunix.UUCP> Date: 15 Dec 89 15:41:30 GMT References: <11500022@hpldoda.UUCP> Sender: news@brunix.UUCP Reply-To: mj@cs.brown.edu (Mark Johnson) Organization: Brown University Department of Computer Science Lines: 19 /* good(List1,List2, ... Listn) is true iff List1 ... Listn * are all of the same length */ good(Lists) :- all_null(Lists). good(OldLists) :- minus_firsts(OldLists, NewLists), good(NewLists). /* all_null(List) is true iff every element of List is [] */ all_null([]). all_null([[]|Rest]) :- all_null(Rest). /* minus_firsts([[_|List1], ... [_|Listn]], [List1, ..., Listn]) */ minus_firsts([], []). minus_firsts([[_|List]|OldLists], [List|NewLists]) :- remove_firsts(OldLists, NewLists).