Finding if a list is within another list
From: briandela (briandela_at_hotmail.com)
Date: 03/30/04
- Previous message: no-spam: "Re: Sublists question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Mar 2004 09:39:08 -0800
Hi All,
I'm looking for some prolog code to determine if a list, e.g. [1,1] is
inside another list.... That's just a simple sublist... but what I
want to do is something like this.
Say I have a list [7,4,2,3,1,1,4,5,6,7] ... I want to be able to
say... give me a list between 2 and 5 and then see if [1,1] is in
that.
I need to get the list that starts with, say 2 and ends with say 5,
and then do a sublist on that.
so the predicate would be something like GetList([start], [stop],
[originalList], X).
Any help would be appreciated.
- Previous message: no-spam: "Re: Sublists question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]