i have the following problem:
i have facts of flights using lists and im trying to find a way to search inside lists.
here's how the facts are described:
flight(london,milan,
[[times(depart(8),arrive(11)),code(ba510),mo,tu,we,th,fr,sa,su],
[times(depart(11),arrive(14)),code(az459),mo,tu,we,th,fr,sa,su]]).
flight(athens,zurich,
[[times(depart(11),arrive(13)),code(oa322),tu,th]]).
flight(london,edinburgh,
[[times(depart(9),arrive(10)),code(ba4732),mo,tu,we,th,fr,sa,su],
[times(depart(11),arrive(12)),code(ba4752),mo,tu,we,th,fr,sa,su],
[times(depart(18),arrive(19)),code(ba4822),mo,tu,we,th,fr]]).
these are not all,but generally theyre all in this fashion.
so for each pair of cities i have a list containing one to three lists with flight info,depending on how flights there are for these two cities.
i need to find a way to search the "outter" list in order to find flight info.the problem is my facts are not all the same as some have 1 flight and others 2 or 3.can anyone help me?
it'd be much appreciated.thank you.
i have facts of flights using lists and im trying to find a way to search inside lists.
here's how the facts are described:
flight(london,milan,
[[times(depart(8),arrive(11)),code(ba510),mo,tu,we,th,fr,sa,su],
[times(depart(11),arrive(14)),code(az459),mo,tu,we,th,fr,sa,su]]).
flight(athens,zurich,
[[times(depart(11),arrive(13)),code(oa322),tu,th]]).
flight(london,edinburgh,
[[times(depart(9),arrive(10)),code(ba4732),mo,tu,we,th,fr,sa,su],
[times(depart(11),arrive(12)),code(ba4752),mo,tu,we,th,fr,sa,su],
[times(depart(18),arrive(19)),code(ba4822),mo,tu,we,th,fr]]).
these are not all,but generally theyre all in this fashion.
so for each pair of cities i have a list containing one to three lists with flight info,depending on how flights there are for these two cities.
i need to find a way to search the "outter" list in order to find flight info.the problem is my facts are not all the same as some have 1 flight and others 2 or 3.can anyone help me?
it'd be much appreciated.thank you.