Counting, Highest Value, No Same Output



hi all... thans for dropping by here... but hope u can help me.... this
is my problem.... in prolog how can we have:

1. counting..... say we wanna count the number of pc type computer from
a given facts:

price(pc,1000.00).
price(pc,2000.00).
price(laptop,3000.00).
price(pc,4000.00).

so, the output(answer) should be 3 that is ther r 3 computers which
type is pc.

2. highest value... say we wanna find a computer with the highest price
from the given facts.... so, the output(answer) should be pc
4000.00......

3. prevent same output..... say we wanna display out who likes to eat
fish... facts:

likes(joe,tuna).
likes(jane,mackerel).
likes(joe,mackerel).
likes(dean,chicken).
likes(jane,finch).

foodtype(tuna,fish).
foodtype(mackerel,fish).
foodtype(chicken,bird).
foodtype(finch,bird).

so, how can i have the correct output without having the same value
more than one....that is:

Who = joe
who = jane

NOT

Who = joe
Who = jane
Who = joe // dont want this cuz it has appeared before.

i realy hope u can help me solving this things....n i preceded with
million thans....

.



Relevant Pages

  • Re: 87 stang and Mobil 1
    ... I assure you that the people I get my information and facts from are far more knowledgeable than you are, in fact being called an idiot by a name calling, Dodge driving clueless wannabe is pretty much moot IMO. ... Wanna try for another? ... How about poor lil hemi, can't keep up with a Toyota or a Nissan and wishes it could get the same mileage. ... most of the words have no meaning in English" - Joe Canuck ...
    (rec.autos.makers.ford.mustang)
  • Re: Counting, Highest Value, No Same Output
    ... say we wanna count the number of pc type computer from ... Roland ...
    (comp.lang.prolog)
  • Re: OIL Companies reply to Congress
    ... me, just reread the "facts" as interpreted by the bondage freak, aka ... If we wanna' stick to the facts, is anyone really going to claim that ... posting history and I was posting before Deja News started archiving usenet. ... If you want to be factual about it, I'm not a "bondage freak". ...
    (rec.outdoors.rv-travel)
  • Re: One in Three (Braindead Americans) in Poll Still Think Saddam Was Involved in 9/11
    ... I wanna be a cowboy and you can be my cowgirl I wanna be a cowboy and ... My name is Joe, And one day I'll be dead yo yo. ...
    (rec.pyrotechnics)
  • Re: OT Loose Change 9-11
    ... Even if there weren't obvious facts to contradict some ... But still, I really wanna ... conspiracy video I've ever seen. ...
    (rec.music.makers.percussion)