[misc.misc] general PROLOG questions

cs211s65@uhccux.uhcc.hawaii.edu (Cs211s65) (12/06/89)

Hello.
  I am currently learning how to use PROLOG for my logic class. It
is an assignment showing the relationship between logic and PROLOG 
language. Please help or give me any relevant information. Few 
questions:
        1)   I need to know how to write a set of PROLOG rules
             that represent the rules of some organizational   
             system such as: the conditions for passing a 
             course in college or for determining eligibility
             for a post graduate grant.

       2)    Using a definitions of the listsize predicate for   
             guidence, a definition for a rule that will return
             the nth element of a given list. For example:    
             nth([a,short,list],2,Nth) should return Nth = short.

       3)    To write a set of PROLOG rules to determine if a given
             list of integers is in ascending order.

       4)    In the following  program:

           /* data */
          line(carlisle, newcastle, 62).
          line(newcastle, middlesbrough, 48).
          line(newcastle, darlington, 36).
          line(darlingtone, middlesbrough, 15).
          line(darlington, northallerton, 14).
          line(northallerton, york, 30).
          line(york, leeds, 25).
          line(leeds, manchester, 43).
          line(manchester, liverpool, 31).
          line(liverpool, preston, 28).
          line(manchester, preston, 31).
          line(preston, lancaster, 21).
          line(leeds, lancaster, 70).
          line(leeds, carlisle, 113).
          line(lancaster, carlisle, 69).

         with two rules:
         link (A,B,D) :-      link(A,B,D) :-
            line(A,B,D).         line(B,A,D).

        and with the of what is the route from A to B and the total distance?
        for example:
   
           | ?- route(manchester,newcastle,Route,Distance).

        is given below:

           route (S,F,R,D) :-
             route 1(S,F,[S],R,D).

           route (S,F,,[],D) :-
             link (S,F,D).

           route 1(S,F,S2,[S1|R],D) :-
            link(S,S1,D1),
            not (member(S1,S2))
            route 1(S1,F,[S1|S2],R,D2)
            D is (D1 + D2).

        then the distances are accumalated in D.

        the question is how to write an enchanced route finding program
        that finds alternative routes and establishes which is the 
        shortest.

       Please send any comments and suggestions to the questions quickly
       as I am currently working on a thesis on the relationship between
       PROLOG and Predicate logic and do not have enough time to become
       an expert in the language. Please, any help is GREATLY appreciated.
       Thank you very much.
                                     Thank you,
                                     Anthony Bush.
       Email me!
       bush@uhccux.bitnet
       thanks.

Tim_N_Roberts@cup.portal.com (12/08/89)

In <5631@uhccux.uhcc.hawaii.edu>,  cs211s65@uhccux.uhcc.hawaii.edu asks us
to do his PROLOG homework for him.

This offends me.  Am I alone in this?  It seems to me that if you "don't 
have the time to become an expert" in the topic of your graduate thesis,
then you darn well better pick another topic for your thesis.  This posting
seems to be a bit like purchasing one of those canned reports instead of
doing research - legal, yes, but ethical?

I don't know.  Maybe I'm overreacting, but I think you're going to need
a pretty fundamental understanding of PROLOG in order to do a worthwhile
comparison of PROLOG to Predicate Logic.

TNR@cup.portal.com                |  I Survived The
...!sun!portal!cup.portal.com!tnr |  Great Quake of '89.

mmh@cs.qmc.ac.uk (Matthew Huntbach) (12/12/89)

This all looks like fairly standard Prolog stuff which could be
found in any introductory text book to the language. You
shouldn't need to post worldwide to get the answers. If you are
too lazy to go to the library and look it up, try asking a few
people around your department for help.

It may be that you are in a place where there are no Prolog
experts and not much guidance to the language. If so, then I
think it would be legitimate to ask for help over the net, but
your posting didn't state that to be the case.

lindsay@comp.vuw.ac.nz (Lindsay Groves) (12/13/89)

In article <1519@sequent.cs.qmc.ac.uk>, mmh@cs.qmc.ac.uk (Matthew
Huntbach) writes:
> ...
> It may be that you are in a place where there are no Prolog
> experts and not much guidance to the language. If so, then I
> think it would be legitimate to ask for help over the net, but
> your posting didn't state that to be the case.

One assumes there must be *some* Prolog expertise in the place --
otherwise, who's teaching the course this guy is taking?  It seems to me
that either:
  (i) the course instructor has not told them much about Prolog nor
provided            sources from which they can fiund information, or
 (ii) this student is trying take the easy way out and get someone in
some other        part of the world to do the work for him -- in which
case Lee's help is           just the sort he deserves!

Then again, maybe he's really overawed by having the ability to talk to
the rest of the world and didn't have anything else to say to us.