Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: newcomer question. Just testing
Just a test. My messages does not seem to appear in this group.  Just testin
g.
Sorry for the inconvenience.

"Anders Lindén" <xxxx@xxx.xx> wrote in message
news:4259a20c$1@griseus.its.uu.se...
> Hello!
>
> I have this scenario:
> There is a lot of beer sorts.
> There are also some pubs where they sell beer.
> beerkind is a predicate that tells that a certain pub has a certain beer.
> What I wanted to do was to write a predicate that can tell if there is a b
eer
> that is only sold in one pub.
> Its used by writing onepub(X)., and seems to work.
> It uses a predicate that can tell if a beer is sold in _many_ pubs, which 
is
> used by manypubs(X)..
> However, it has the weakness of listing a certain beer many times!
> How is that solved?
>
> source follows:
>
>
> beer(guinness).
> beer(fiddlers_armbow).
> beer(pripps_bla).
> beer(pripps_yellow).
> beer(fulblask).
>
> pub(mcgills).
> pub(sheers).
> pub(pelles).
> pub(nisses).
> beerkind(mcgills, guinness). % mcgills has guinness
> beerkind(mcgills, fiddlers_armbow).
> beerkind(sheers, pripps_bla).
> beerkind(sheers, guinness).
> beerkind(nisses, pripps_yellow).
> beerkind(pelles, pripps_yellow).
> beerkind(pelles, guinness).
>
> manypubs(X):-  beerkind(A,X),beerkind(B,X),different(A,
B).
> nopubs(X):- beer(X),not(beerkind(_,X)).
> onepub(X):- beer(X),not(manypubs(X)),not(nopubs(X)).
> not(X):- X,!,fail;true.
> different(X,Y):- not(X=Y).
>
>


Report this thread to moderator Post Follow-up to this message
Old Post
George Sp
04-13-05 08:59 PM


Re: newcomer question. Just testing
its ok, your message came in 3 copies, maybe you should get another news rea
der? :)

I have not tested what you have written yet, I just read it, but it certainl
y seems interesting!

/Anders


"George Sp" <nobots@noagents.com> wrote in message news:d3jikc$s2g$1@titan.btinternet.com..
.
> Just a test. My messages does not seem to appear in this group.  Just test
ing.
> Sorry for the inconvenience.
>
> "Anders Lindén" <xxxx@xxx.xx> wrote in message
> news:4259a20c$1@griseus.its.uu.se... 
>



Report this thread to moderator Post Follow-up to this message
Old Post
Anders Lindén
04-14-05 08:58 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Prolog archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:05 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.