Index of list (2)
From: John van Terheijden (john-foobar-nl)
Date: 01/21/04
- Next message: Nick Wedd: "Re: newbie question: prolog,AI,study,work"
- Previous message: Paul Tarau: "Re: Recommendations for a free Prolog interpreter in Java"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 21 Jan 2004 15:05:00 +0100
Let me describe my problem again, shorter:
With Database containing ...
[
[
id: 1,
name: dog,
legs: [
number: 4,
size: normal
],
likes: bones
],
[
id: 2,
name: cat,
legs: [
number: 4,
size: short
],
hates: water
]
]
... I want, after "makeIndex(Database, Index)", Index to contain ...
[
name: [
dog: [1], % Means: top-level element of Database with id: 1 has
the value dog here
cat: [2]
],
legs: [
number: [
4: [1, 2] % Both elements with id 1 and 2 have value 4 here
],
size: [
normal: [1],
short: [2]
]
],
likes: [
bones: [1] % Not all properties have to be present in Database,
id:1 likes bones
],
hates: [
water: [2] % and id:2 hates water
]
]
Note that id is not included in the index, but instead is used to refer to
the top-level elements in Database.
Any help or sugestions on writing makeIndex/2 is appreciated.
If something isn't clear, please let me know.
Thanks,
- John
- Next message: Nick Wedd: "Re: newbie question: prolog,AI,study,work"
- Previous message: Paul Tarau: "Re: Recommendations for a free Prolog interpreter in Java"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|