Re: RA with MV attributes

From: Neo <neo55592_at_hotmail.com>
Date: 16 Jan 2007 08:49:19 -0800
Message-ID: <1168966159.486996.75140_at_a75g2000cwd.googlegroups.com>


> r1(Names,Cars)
>     bill,               car1,car2,car4
>     john,fred        car3
>
> r2(Cars,Colours)
>    car1,car3,car4   red
>    car2                  green
>
> r1 |X| r2 (Names,Cars,Colours)
>    bill              car1,car4    red
>    bill              car2           green
>    john,fred      car3           red
>    john,fred                       green

Below is a related (but not same) example using dbd:

(new 'red 'color)
(new 'green 'color)

(new 'car1 'car)
(set car1 color red)

(new 'car2 'car)
(set car2 color green)

(new 'car3 'car)
(set car3 color red)

(new 'car4 'car)
(set car4 color red)

(new 'bill 'person)
(set bill has car1)
(set bill has car2)
(set bill has car4)

(new 'john 'person)
(set john has car3)

(new 'fred 'person)
(set fred has car3)

(; Get persons who have car3)
(; Gets john, fred)
(get * has car3)

(; Get persons who have red cars)
(; Gets bill, john, fred, bill again)
(get * has (get * color red))

(; Get persons who have cars1 and 2)
(; Gets bill)
(& (get * has car1)

    (get * has car2))

(; Get persons who have cars3 or 4)
(; Gets john, fred, bill)
(| (get * has car3)

   (get * has car4)) Received on Tue Jan 16 2007 - 17:49:19 CET

Original text of this message