HDTenEightyP/NetNews huggingface dataset:
From: tdo@dcs.exeter.ac.uk (Tony Dodd)
Newsgroups: comp.lang.prolog
Subject: DCGs in ISO Prolog
Date: 5 Oct 92 19:25:01 GMT
Organization: Computer Science Dept. - University of Exeter. UK

DCGs in Prolog

The ISO Prolog group, WG17, has been discussing whether DCG rules 
should be included in the ISO Prolog standard and if so, what the 
definitions should be. Most of the discussion has taken the form of 
mail between members of the group.

I have produced an archive of the correspondence to date. This consists 
of the original proposal and 36 mail items of varying lengths. The whole 
archive amounts to some 150K.

If you would like a copy of the archive, with a view to adding your own 
views or just out of curiosity, please mail me a request at

tony@compsci.bristol.ac.uk

and I will send it to you. You can also send me messages for forwarding 
to WG17 members interested in DCGs.

Tony Dodd
From: pjr@cs.uq.oz.au (Peter Robinson (P.J.))
Newsgroups: comp.lang.prolog
Subject: a question about read
Date: 28 Sep 92 21:32:33 GMT
Reply-To: pjr@cs.uq.oz.au


How does your favourite Prolog behave in the following situation

query:  ?- read(f(X)).

input:  3.



I already know the following:

Nu-Prolog :  
      continue to input until the input is of the form f(term).

Qu-Prolog & IC-Prolog: 
      fail - 3 and f(X) don't unify.

LPA MacProlog : 
      fail - argument of read must be a variable at the time of call.



Peter Robinson, Department of Computer Science, University of Queensland
email: pjr@cs.uq.oz.au

Newsgroups: comp.lang.prolog
From: matsc@sics.se (Mats Carlsson)
Subject: Re: conf. on applications of Prolog
Organization: Swedish Institute of Computer Science, Kista
Distribution: comp
Date: Thu, 1 Oct 1992 07:59:46 GMT

In article <1992Sep30.144623.7717@di.unipi.it> cianca@di.unipi.it (Paolo Ciancarini) writes:

   I need the complete reference
   fro the proceedings of the Conf.
   on Applications of Prolog, held in London
   this year in April. Who was the editor
   and the publisher of the proceedings?

Try:

	Al Roth
	PO Box 137
	Blackpool
	Lancashire FY2 0XY, UK
	Tel:	+44-253-58081
	Fax:	+44-253-53811
	Email:	alroth@cix.compulink.co.uk

--
Mats Carlsson
SICS, PO Box 1263, S-164 28  KISTA, Sweden    Internet: matsc@sics.se
Tel: +46 8 7521543     Ttx: 812 6154 7010 SICS     Fax: +46 8 7517230
From: kodiak@champ.ksu.ksu.edu (Bryan D. Nehl)
Newsgroups: comp.lang.prolog
Subject: turbo prolog
Date: 30 Sep 1992 14:48:59 -0500
Organization: Kansas State University
NNTP-Posting-Host: champ.ksu.ksu.edu

I have Turbo Prolog 2.0 and I am getting pretty excited about getting
started with it.  The features and the toolkit items look pretty
impressive.  The questions that I have are:

Is this the latest version of turbo prolog put out by borland?

Is there a way to compile your code on the command line with makefiles
and the like?  For example with c you would just say cc prog.c -o prog.

thanks.

Bryan.

/* === Bryan Nehl ========== kodiak@Kodiakpc.Manhattan.KS.US =========+
[            USDA-ARS-NPA-WERU          ][ bdn@chepil.weru.ksu.edu    ]
[     913.532.6233 or 913.532.6495      ][ kodiak@matt.ksu.ksu.edu    ]
+_______________ ...!rutgers!matt.ksu.ksu.edu!kodiak _______________ */
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.lang.prolog
Subject: Re: retract*all
Date: 6 Oct 92 04:49:17 GMT
Organization: Comp Sci, RMIT, Melbourne, Australia

In article <uLBXRB2w165w@lcraft.ersys.edmonton.ab.ca>, cduguay@lcraft.ersys.edmonton.ab.ca (Claude Duguay) writes:
> This may seem sill or I might be missing part of this conversation but
> would it not be easier and just as portable to use a simpler 
> implementation of retractall/retract_all rather than creating elaborate 
> solutions to emulate compiler directives:

>         myretractall(Term) :-
>                 retract(Term),
>                 fail.
>         myretractall(_).

There are two snags:
(1) There may be substantial performance advantages to using the built in
    method.  (For example, Quintus Prolog uses the Lindholm/O'Keefe model
    for data base changes, and retractall/1 could count as one "clock tick"
    rather than several.)
(2) In a Prolog with modules, such as Quintus Prolog or ALS Prolog, you will
    have to add some kind of declaration to myretractall/1, while the built
    in version is already module-aware.
(3) The really big problem is that the indicated code for myretractall/1 is
    wrong.  For example, if I have
	p(a).
	p(b) :- q(c).
    then retractall(p(_)) is supposed to retract _both_ clauses, but this
    definition will only retract the first.  You would need

	myretractall(Term) :-
		clause(Term, _, Ref),
		erase(Ref),
		fail ; true.

    Because some Prolog vendors have not provided clause/3 and erase/1, you
    would have to do something like

	myretractall(Term) :-
		clause(Term, Body),
		my_retractall_aux(Term, Body),
		fail ; true.

	my_retractall_body(Head, Body) :- Body == true, !,
		retract(Head),
		!.
	my_retractall_body(Head, Body) :-
		retract(Head :- Body),
		!.

It would all really be much simpler if vendors would just provide retractall/1
with the same name and semantics. 

-- 
RMIT policy requires the use of Gender Inclusive Language in all publications
and in all information conveyed to students, staff, and potential job
applicants.  Lapses into English are the sole responsibility of the author.
The Constitution of Australia does _not_ guarantee Freedom of Speech.
From: cduguay@lcraft.ersys.edmonton.ab.ca (Claude Duguay)
Newsgroups: comp.lang.prolog
Subject: Turbo Prolog w/Pascal
Date: Wed, 30 Sep 92 10:47:53 MDT
Organization: LogiCraft Corp, Edmonton, AB, Canada

My appologies if I haven't mastered the intricacies if Internet - this
is my first response to a public message and I've only been set up for
two days...
 
Assuming this might get lost because of bad addresing, the message is
a response to a fellow trying to link Turbo Prolog with Turbo Pascal.
 
I provide service for Borland and the Prolog Development Center on
CompuServe (PDC Prolog use to be Turbo Prolog).
 
As I recall, the initialization code between Turbo Prolog and Turbo 
Pascal creates potential conflicts in certain areas so this is not a 
highly recommended approach. Better to use a C/Prolog link since Turbo 
Prolog was written on a C foundation.
 
Jeff Dunteman, who now runs PC Techniques magazine and used to run 
Borland's short-lived Turbo TECHNIX magazine, published an article in
Turbo TECHNIX that included code that translated Turbo Pascal TPUs to
OBJ code. It may still be available through Borland or by contacting Jeff 
at PC Techniques. Other than using this approach, I know of no other that 
would solve your problem directly.
 
The folks at PDC Atlanta are very knowledgeable and ready to help if
you would like to ask if they have the code or can offer another 
solution. You can contact Michael Alexander at (404) 873-1366 and he will 
be in the best position to answer your question and provide the most 
suitable solution available.

Claude Duguay              cduguay@lcraft.ersys.edmonton.ab.ca
From: Bert.Edens@f1160.n391.z1.FidoNet.Org (Bert Edens)
Newsgroups: comp.lang.prolog
Subject: Question about adding
Date: 5 Oct 92 12:05:00 GMT

Greetings...
    I wanted to get some suggestions on the best way to attack a problem.
I'm writing an adventure-type of game (no, not for a class :-) and wanted
to know the quickest way to add up their total hit points. The fact is
stored like:
    monster(orc,4).
where the latter is the number of hit points. What I want to do is add up a
group of them and get the total hit points for an attack party. For
example, it might be:
    monster(orc,4). monster(kobold,5). monster(goblin,8).
and I want to add them up.

Thanks...
   -Bert

 * Origin: Hillbilly Korner BBS - (501) 751-3714 (1:391/1160)
Newsgroups: comp.lang.prolog
From: ludemann@quintus.com (Peter Ludemann)
Subject: Re: How to cleanup side effects after cut?
Keywords: cut, side effects, rewriting clauses
Organization: Quintus Corporation, Palo Alto, CA
Date: Thu, 24 Sep 1992 18:10:35 GMT

In article <525@tower1.uucp>, arjen@disnet.uucp (Arjen Duursma) writes:
> I am not sure because I do not know the appication at hand, but
> I think that a proper implementation of a cleanup would function like
> the next example.
> 
> goal :- (sideeffects,somegoal);(undosideeffects,othergoal).
> 
> If you find out that the sideeffects (like opening a file) where not
> needed, fail, and undo them.
> 
> Hope that this is what you have been looking for.
> 

If only it were so simple!

Consider:  ?- goal, !, fail.

The cut will have removed the choice point created by the ";"
in goal/0, so undosideeffects/0 will not be executed.

What you need is something on the "choice point" stack which is executed
upon backtracking.  Various Prologs have this for internal use, but I'm
not aware of any which provide it has a defined user predicate.  (If your
Prolog has an interface to an RDBMS in which backtracking gets new rows,
chances are it has such a hidden predicate.)

-- 
	Peter Ludemann  +1-415-813-3800  ludemann@quintus.com
Newsgroups: comp.lang.prolog
From: alan@geg.mot.com (Alan Newman)
Subject: Re: a question about read
Organization: Motorola, Scottsdale, Arizona
Date: 2 Oct 92 07:07:47
Followup-To: comp.lang.prolog
	<290992115341@brady.cs.tcd.ie> <23753@alice.att.com>
	<brady-300992144101@brady.cs.tcd.ie>

In article <brady-300992144101@brady.cs.tcd.ie> brady@cs.tcd.ie (Michael Brady) writes:

>  For get0(Char), it read in a character, and if the character didn't unify
       ^^^^^^^^^^
>  with Char, it would advance to the next character and try again, ad
>  infinitum until the right character was read.
>  Is my memory playing tricks on me?

Reminds me of skip/1, but my memory is always playing tricks on me.

Alan Newman
--
I use smiley faces all the time, but I usually leave off the mouth. :-)
Newsgroups: comp.lang.prolog
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.lang.prolog
Subject: Re: a question about read
Date: 6 Oct 92 04:42:02 GMT
Organization: Comp Sci, RMIT, Melbourne, Australia

In article <brady-300992144101@brady.cs.tcd.ie>, brady@cs.tcd.ie (Michael Brady) writes:
> My memory, which could easily be wrong, was that if for read(Term), it read
> in the first term it came across, and failed if that term wasn't unifiable
> with Term. It would also report syntax errors...
> For get0(Char), it read in a character, and if the character didn't unify
> with Char, it would advance to the next character and try again, ad
> infinitum until the right character was read.
> Is my memory playing tricks on me?

Yes.

All the input commands in DEC-10 Prolog had the same behaviour: guessing
wrong about the output argument does not affect which side effects take
place, only whether the query succeeds or fails.

In a mix of Prolog and C:

	get0(Char) :-
		( feof(current_input) -> error
		; Char is getc(current_input),
		).

	get(Char) :-
		( feof(current_input) -> error
		; Temp is getc(current_input),
		  ( Temp =:= EOF ->
		    Char is 26	% in DEC-10 Prolog
		    Char is -1  % in just about every other Prolog since
		  ; isspace(Temp) ->
		    get(Char)
		  ; Char is Temp
		  )
		).

	skip(Char) :-
		C is Char,	% Char may be an expression
		repeat,		% repeat/0 is needed because
		    get0(C),	% get0(C) WON'T skip
		!.

	read(Term) :-
		repeat,
		    get_tokens(Tokens),
		    parse(Tokens, Result),
		!,
		Term = Result.

> The real question is what is the most desirable action in these cases. I
> agree with Lee about read/1, but how about get0/1 and get/1?

They should be compatible with DEC-10 Prolog, C Prolog, PDP-11 Prolog,
Prolog-X, SICStus Prolog, NU Prolog, Quintus Prolog, &c.  It would be best
if the default behaviour was to return -1 for EOF, but a DEC-10 compatibility
mode would be of use as at least once PC implementation still uses 26 for
EOF (because CP/M did, basically).
-- 
RMIT policy requires the use of Gender Inclusive Language in all publications
and in all information conveyed to students, staff, and potential job
applicants.  Lapses into English are the sole responsibility of the author.
The Constitution of Australia does _not_ guarantee Freedom of Speech.
Newsgroups: comp.lang.prolog,comp.ai
From: mramesh@cbnewse.cb.att.com (m.ramesh)
Subject: SB-Prolog
Organization: AT&T
Distribution: na
Date: Mon, 28 Sep 1992 13:51:44 GMT
Followup-To: poster
Keywords: number of facts, rules, tuples, expert systems

I am developing an expert system using SB-prolog.  I wanted to know if there any
restrictions on the number of facts and rules I can use with SB-prolog
or is it dependent only upon system memory.  Actually I do not have too many
prolog style rules, but my rules are stored as facts.  SO is there any limit
on the number of tuples I can use.

Thanks

Masoor Ramesh

Newsgroups: comp.lang.prolog
From: truemf@craft.camp.clarkson.edu (Jake)
Subject: Looking for....
Summary: Wanted: a current up to date, good, version of Prolog for the PC
Organization: Clarkson University
Date: Tue, 6 Oct 1992 02:28:13 GMT

Anyone out there know of a current up to date reasonably useful
PD-Prolog or freely distributable prolog for the PC?

I have a copy of prolog 19 and I am wondering if that is the latest.

Also a good book on programming prolog would be helpful.

Thanks in advance
Mark True

P.S. Could you send either a place to FTP or something telling me where I can find it to truemf@craft.camp.clarkson.edu
From: alberto@cs.umd.edu (Jose Alberto Fernandez R)
Newsgroups: comp.lang.prolog
Subject: Re: Writing portable code.
Date: 29 Sep 92 16:41:49 GMT
Organization: University of Maryland Computer Sc.
In-reply-to: csa09@seq1.keele.ac.uk's message of 29 Sep 92 00:57:33 GMT

In article <BvBEny.4M8@gabriel.keele.ac.uk> csa09@seq1.keele.ac.uk (Paul Singleton) writes:

   Prolog is a sufficiently wide-spectrum language that we don't need to
   borrow bolt-on programming-in-the-large languages.  I think if we write

	   retract_all_unit_clause( X) :-
		   (	dialect( sepia)
		   ->	retract_all( X)
		   ;	dialect( sicstus)
		   ->	retractall( X)
		   ).

   then add either

	   dialect( sepia).
   or
	   dialect( sicstus).

   as a fact, and partially evaluate the program, we get the effect of macro
   substitution.  Isn't this a neater way of doing things?  

I have some problems in using partial evaluation as the means of
achieving this. In particular the partial evaluator will modify not
only those parts of the program that have to do with the dialects but
it will also modify other parts of the program that have nothing to do
with it. If for example, the code represents a library, you have two
alternatives:

1) To partially evaluate the code when the libraries are installed, in
this case the version of the libraries the the users have access to,
have been partially evaluated and therefore its logical structure has
being modified. It will not be easy to read since many predicates have
beeing optimized (partially evaluated).

2) To partially evaluate the code when the library is loaded. In this
case, the system must doit automatically. You can not put the burden
of nowing what must be partially evaluated and what not, to the user
of a shipped peace of software.

The advantage of using a macro processor (not necessarily CPP) is that
the instalation language is separated from the object language. It is
very clear what is a statement about how to install the software and
what is a statement of the code of the language.
With partial evaluation we mix the two as if they were talking about
the same thing.

	Jose Alberto.

--
:/       \ Jose Alberto Fernandez R | INTERNET: alberto@cs.umd.edu
:| o   o | Dept. of Computer Sc.    | BITNET: alberto@cs.umd.edu
:|   ^   | University of Maryland   | UUCP: {...}!mimsy!alberto
:\  \_/  / College Park, MD 20742   |
From: cwalker@canopus.bucknell.edu (carleton walker `93)
Newsgroups: comp.lang.prolog
Subject: Re: Comprehensive understanding of logic languages
Date: 3 Oct 92 17:55:35 GMT
Article-I.D.: coral.1akmqnINNihd
Organization: Bucknell University, Lewisburg, PA
NNTP-Posting-Host: canopus.cs.bucknell.edu

In article <92276.202706COMTET@FRECP12.BITNET> <COMTET@FRECP12.BITNET> writes:
>Recently I had courses in languages such as Prolog and Lisp. The beginning of t
>he course was an attempt to describe comprehensively all logic languages. There
>are some terms that I didn't quite understand such as :

>Horner's clause ( or assertion)
>Could somebody give me either the meaning of those words or give me references

	A Horn clause is any rule, fact, or query.
	
	Rules have the form A :- B1, B2, ... Bn.
	Facts have the form A.
	Queries have the form ?- A.

	"Languages have tended to work with Horn clauses because Horn
clauses lead to efficient implementations" (Sethi).

Carl Walker
--
Carl Walker				"Hectic days ahead of us,
Bucknell University			 Rotten ones behind,
Lewisburg, PA				 Keeping plastics in our pockets,
cwalker@canopus.bucknell.edu (! tmc.edu) Children never mind." - K, S, & W
Newsgroups: comp.lang.prolog
From: michaelh@stud.cs.uit.no (Michael Hinz)
Subject: Re: Need help with prolog
Organization: University of Tromsoe, Norway
Date: Mon, 5 Oct 1992 15:24:43 GMT

In article <CONERY.92Sep27133023@kiwanda.cs.uoregon.edu>, conery@kiwanda.cs.uoregon.edu (John Conery) writes:
|> In article <1992Sep26.175623.16840@tom.rz.uni-passau.de> baier@forwiss.uni-passau.de (Joern Baier) writes:
|> 
|>    In article <1992Sep20.182451.25920@ultb.isc.rit.edu> cjb3701@ritvax.isc.rit.edu writes:
|>    >Any info for a new student of prolog (myself) who is having a difficult
|>    >time with the language?  ...
|> 
|>    PROLOG is like riding a bike with your front directed backwards. Even if
|>    you are a good biker you will have a lot of troubles to ride a bike that way.

Well, I think it's more like baking cookies like that:

Imagine what cookies taste like... and write that down.
Imagine what cookies smell like... and write that down.
Imagine what cookies look like... and write that down.

Having done that, you show it to your oven, hoping it comes with a recipe ;-)

Of course, the biggest mistake you can make _before_ learning Prolog is to learn
_any other_ computer language!
-- 
Michael Hinz ! turn your pc into a game boy? just type 'win' at the dos prompt!
-------------+---------------------------------------+-------------------------
when the going gets tough, the bard goes drinking... ! michaelh@stud.cs.uit.no
From: mcovingt@aisun3.ai.uga.edu (Michael Covington)
Newsgroups: comp.lang.prolog
Subject: Re: Efficiency
Date: 5 Oct 92 15:11:59 GMT
Organization: AI Program, University of Georgia, Athens

In article <1992Oct5.102142.16636@ecrc.de> micha@ecrc.de writes:
>In article 28120@athena.cs.uga.edu, mcovingt@aisun3.ai.uga.edu (Michael Covington) writes:
>>        other language.  We once ported a simple Prolog list processing
>>        routine into Pascal as a test, and got a factor-of-14 *slowdown*!)
>
>It is nice that People really do believe in Prolog, but there must be a mistake here.
>...You must have dome something funny in your Pascal translation, or it was
>a very slow Pascal. 

It was the speed of "new" and "dispose" in Pascal versus the much faster
dynamic memory allocation in Prolog.


-- 
:- Michael A. Covington     internet mcovingt@uga.cc.uga.edu 
:- Artificial Intelligence Programs       phone 706 542-0359
:- The University of Georgia                fax 706 542-0349
:- Athens, Georgia 30602 U.S.A.          amateur radio N4TMI
From: kjell@cse.ucsc.edu (Kjell Post)
Newsgroups: comp.lang.prolog
Subject: Writing portable code.
Date: 27 Sep 1992 08:54:11 GMT
Organization: University of California, Santa Cruz (CE/CIS Boards)
Distribution: world
NNTP-Posting-Host: arapaho.ucsc.edu


Let me explain by an example what I'm looking for.  I want to write a
program that works for both SICStus Prolog and Sepia.  The problem is
that I need to retract all clauses foo/n when the program is started.
Now, in SICStus the procedure is called retractall/2, but in Sepia it
is retract_all/2.  That extra underscore (or absence of it) is really 
annoying!  So I'd like to hear about efficient and portable tricks to
write code that works in both languages.

	Should I use call/1?  

	Should I write "retractall(H) :- retract_all(H)." and rely
	on the fact that SICStus just issues a warning when an
	a built-in predicate is being redefined?

	Any better ideas?

--Kjell	kjell@cs.ucsc.edu
Xref: sparky comp.lang.prolog:1848 sci.logic:1667
From: pereira@alice.att.com (Fernando Pereira)
Newsgroups: comp.lang.prolog
Subject: Re: a question about read
Date: 29 Sep 92 17:53:15 GMT
Article-I.D.: alice.23753
Reply-To: pereira@alice.UUCP ()
Organization: AT&T, Bell Labs

In article <290992115341@brady.cs.tcd.ie> brady@cs.tcd.ie (Michael Brady) writes:
>3. Can anyone remember what DEC10 Prolog did? If memory serves, the
>behaviour of get/1 and read/1 were different in this regard.
Unfortunately I no longer have access to a DEC-10, and the DEC-10
Prolog sources are sitting on a tape that would be a hassle to restore, but
according to the manual and my recollection both read(X) and get(C)
advance the input appropriately and try to unify the object scanned
with their argument. If the unification fails, the advancing of the input
stream is not undone, but the calls fail.

Fernando Pereira
2D-447, AT&T Bell Laboratories
600 Mountain Ave, PO Box 636
Murray Hill, NJ 07974-0636
pereira@research.att.com



Newsgroups: comp.lang.prolog
From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
Subject: Re: Writing portable code.
Organization: Computer Science, University of Melbourne, Australia
Date: Thu, 1 Oct 1992 12:39:09 GMT

bevan@cs.man.ac.uk (Stephen J Bevan) writes:

>When all said and done, you prefer the separate language approach and
>I prefer the single language approach (preferably using partial
>evaluation).  I'm not out to convince anyone that the single language
>approach is best and am willing to be convinced by the other side of
>the argument, however I've yet to see a technical argument for it
>(i.e. something other than "I don't like ...").  Is there a technical
>argument of any sort or is this a purely subjective issue?

There *is* a technical argument for using a separate preprocessing language.
Often it is not just names (retractall vs. retract_all) that differ between
compilers, sometimes it is the very syntax of the language itself that varies.
In these cases you need the two-level approach so that you can prevent
the compiler from attempting to parse something that it cannot possibly
understand.

Fortunately for Prolog users, the syntax of Prolog is very simple and fairly
standardized. Most of the various language extensions are confined to
Prolog's ?- or :- directives, the Prolog equivalent to C's #pragma.
However even amoung these there are some cases when one might require
the two-level approach. For example:

#if nu_prolog
    ?- foo(X) when X.	% other systems may choke on this
    foo(X) :- foo1(X).
#else
    foo(X) :- (var(X) -> error('argument to foo is not bound') ; foo1(X)).
#endif

I'm sure there are many other such examples. Another that comes
to mind is type declarations.

-- 
Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
This .signature virus is a self-referential statement that is true - but 
you will only be able to consistently believe it if you copy it to your own
.signature file!