HDTenEightyP/NetNews huggingface dataset:
From: torkel@sics.se (Torkel Franzen)
Subject: Re: Comprehensive understanding of logic languages
Organization: Swedish Institute of Computer Science, Kista
Date: Sat, 3 Oct 1992 18:47:48 GMT

In article <1akmqnINNihd@coral.bucknell.edu> cwalker@canopus.bucknell.edu
 (carleton walker `93) writes:

   >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.

  "?- A"? What does this mean? Does it have something to do with
logic? Anyway, you left out the information needed for a truly
comprehensive understanding of logic languages. Horn clauses are so
named after Alfred Horn, who showed that theories axiomatizable using
Horn clauses are precisely those whose models are closed under
substructures and direct products. The significance of this fact is
immense, or at any rate not to be sneezed at.
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.lang.prolog
Subject: Re: a question about read
Date: 29 Sep 92 02:23:08 GMT
Organization: Comp Sci, RMIT, Melbourne, Australia

In article <10468@uqcspe.cs.uq.oz.au>, pjr@cs.uq.oz.au (Peter Robinson (P.J.)) writes:
> How does your favourite Prolog behave in the following situation
> query:  ?- read(f(X)).
> input:  3.

DEC-10 Prolog, C Prolog, Quintus Prolog, &c all fail.

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

This is a *bug*.  Here's what the on-line manual says:

2?- man read.
read(Term)
read(Stream, Term)
(Non-logical).
Read a NU-Prolog Term, terminated by a period and white space, from the current
input  stream  (or  Stream).   All terms before the first syntactically correct
term are ignored.  If Term contains variables these are distinct from variables
not   in  the  term.   At  end-of-file,  read/1  and  read/2  return  the  atom
end_of_file.  Fails if Term will not unify with the term that is read.
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The manual describes the intended behaviour, which is just the same as other
Prolog systems.  Report the error.

I have just fixed the error in my copy of NU Prolog (it's in the file
sys/io.nl, and the error is really obvious).  I've notified the maintainer.

-- 
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
From: goldsmig@cgsvax.claremont.edu
Subject: Re: Writing portable code./partial evaluation
Organization: The Claremont Graduate School
Date: 1 Oct 92 07:44:01 PST


In article <BvBEny.4M8@gabriel.keele.ac.uk>, csa09@seq1.keele.ac.uk (Paul Singleton) writes:
> From article <ALBERTO.92Sep28113506@karna.cs.umd.edu>, by alberto@cs.umd.edu (Jose Alberto Fernandez R):
> 
>> One way to solve this is to use in the code macro commands that
>> expand to the right thing for each system. Assume that your
>> distributed source code is in files with extensions `.pli'. 
>> In your case, the macro definitions look something like this:
>> 
>> 	#ifdef SEPIA
>> 	#define RETRACTALL(x) retract_all(x)
>> 	#else
>> 	#define RETRACTALL(x) retractall(x)
>> 	#endif
>> 
>> and in your code you use the macro RETRACTALL(x):
>> 
>> 	...:- ..., RETRACTALL(foo(X,Y)), ....
>>... 
>> It would be nice if a facility like this would have been provided as
>> part of the language. Then we wouldn't need to borrow tools from 'C'.
> 
> 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?  
> ----
>   __   __    Paul Singleton (Mr)           JANET: paul@uk.ac.keele.cs
>  |__) (__    Computer Science Dept.        other: paul@cs.keele.ac.uk
>  |  .  __).  Keele University, Newcastle,    tel: +44 (0)782 621111 x7355
>              Staffs ST5 5BG, ENGLAND         fax: +44 (0)782 713082
Sorry to be on the ignorant side, but what is meant by partial evaluation?
Newsgroups: comp.lang.prolog
From: brady@cs.tcd.ie (Michael Brady)
Subject: Re: a question about read
Followup-To: comp.lang.prolog
Organization: University of Dublin, Trinity College
Date: Tue, 29 Sep 1992 10:57:28 GMT

Three points:
1. Open Prolog misbehaves on this - it succeeds no matter what you input,
but will only bind variables if the term to be read and the term actually
read are unifiable. Clearly most undesirable. Mhust be shome mhistake.

2. In Richard O Keeffe's extract from the NU-Prolog manual, there is a
sentence:
'All terms before the first syntactically correct term are ignored.' What
does that mean?

3. Can anyone remember what DEC10 Prolog did? If memory serves, the
behaviour of get/1 and read/1 were different in this regard.
Can anyone comment?

_________________________
Mike Brady
Computer Science Department, Trinity College Dublin, Ireland
Newsgroups: comp.lang.prolog
From: pds@quintus.com (Peter D. Schachte)
Subject: Re: postfix operators - does anyone need them?
Organization: Quintus Corporation, Palo Alto, CA
Date: Wed, 30 Sep 1992 20:56:20 GMT

In article <CHIK.92Sep22103654@ss38.icot.or.jp>, chik@icot.or.jp (Takashi Chikayama) writes:
> In article <PLUMMER.92Sep21105425@cilantro.cs.swarthmore.edu>
> 	plummer@cs.swarthmore.edu (David Barker-Plummer) writes:
>  DBP> With [distfix ops] you declare an operator as a collection of symbols
>  DBP> including an opener, closer and separators.  So for example, a distifx
>  DBP> operator declared with < as the opener, > as the closer and , as the
>  DBP> separator, would allow you to read <a,b>, as perhaps '<,>'(a,b).
> 
> That may be handy in some cases, but I think declaring only the
> parentheses will be enough, and thus we don't have to further
> complicate the mechanism.

The advantage of a formalized distfix syntax extension is the same as
the advantage of formalized bracketing:  error detection.  For example,
if you wanted to add if-then-elseif-then-else-endif syntax to Prolog,
you could declare each of these words as an operator of the appropriate
precedence.  But this would push syntax checking out of the reader, and
into your term_expansion/2 code (or to runtime).  Prolog's reader would
quite happily read

	test :- if foo.

as a valid clause.  Adding a bracketing syntax extension would prevent
this by requiring the matching endif, but would still be quite happy to
read

	test :- if foo endif.

which is equally nonsensical.

I haven't seen any formal proposals for a distfix extension; does anyone
have one?  Does it support required and optional term parts?  Repeated
parts?  What kind of flexibility does it give users to control the
structure of the (sub)term ultimately returned?  It seems to me like a
hard problem to design such an extension.

-- 
-Peter Schachte
pds@quintus.com
From: arindam@cs.uwindsor.ca (Arindam Das)
Newsgroups: comp.lang.prolog
Subject: target code in LISP
Keywords: Prolog, Lisp, translator
Date: 2 Oct 1992 22:20:49 GMT

missing keywords: Common Lisp, Scheme
 Hi !

I am looking for a sample source code of a program
written in Prolog that takes input in some language
in a certain format and produces the output 
(the target code) in Common LISP or Scheme or any other
LISP version ?

Could someone give me some hint ?

-arindam
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.lang.prolog
Subject: Re: Graph Traversal
Keywords: Prolog, Graph
Date: 6 Oct 92 12:15:33 GMT
Organization: Comp Sci, RMIT, Melbourne, Australia

In article <1605@newsserver.cs.uwindsor.ca>, arindam@cs.uwindsor.ca (Arindam Das) writes:
> Now, In my program i need to do complex traversal of the graph.
> I being at ease in using Prolog (Quintus Prolog), am using it
> comfortably and i am finding that i can develop the code pretty
> quickly.

> However I have to defend the use of Quintus Prolog instead of C.

You just gave the best possible defence.  It wouldn't matter how wonderful
Prolog is if _you_ couldn't use it effectively for _your_ application.
Tell whoever is hassling you that you are "developing an executable
specification" and that you are willing to implement the final version
in C or whatever _IF_ there is a need for a really fast implementation
and _ONCE_ you have measurements on a working executable specification
which tell you what C data structures would be appropriate.  (I have
just pointed out to my 2nd year data-structures-in-Pascal students that
using the building blocks I have given them they can put together over
256 distinct implementations of graphs, and that's only counting versions
based on adjacency matrices/lists.  You need to know what operations your
_whole_ program performs and how often it performs each before you can
choose the best building blocks.)  Point out that it will be easier to
recode to the "right" C implementation from a high level specification
than from a low level one, so that if and when you _do_ need a C version
you are likely to get a better one than if you had started hacking right
away.
-- 
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: siegl@risc.uni-linz.ac.at (Kurt Siegl)
Subject: Re: Logic Programming
Organization: RISC, J.K. University of Linz, Austria
Distribution: usa
Date: Tue, 29 Sep 1992 08:42:10 GMT

In article <1992Sep29.022437.15265@news2.cis.umn.edu>, bob@sparkie.nrri.umn.edu (Robert I. Benett) writes:

> I am investigating parallel or distributed processing of Logic programs.
> 
> Anyone have any suggestions for reading material??
> 

A good starting point into the field of Guarded Horn Clause languages, which are
the most useful ones for parallel aplications I would suggest:

@book{Shap87,
editor = {Shapiro, Ehud},
title = {{Concurrent Prolog, Collected Papers, Volumes 1 and 2}},
publisher = {MIT Press},
address = {Cambridge, Massachusetts},
year = {1987},
}

@book{FoTa89,
author = {Foster, Ian  and Taylor, Stephen},
title = {{Strand --- New Concepts in Parallel Programming}},
publisher = {Prentice-Hall},
address = {Englewood Cliffs, New Jersey},
year = {1989},
}
From: conery@kiwanda.cs.uoregon.edu (John Conery)
Newsgroups: comp.lang.prolog
Subject: Re: Need help with prolog
Date: 27 Sep 92 21:30:23 GMT
Article-I.D.: kiwanda.CONERY.92Sep27133023
	<1992Sep26.175623.16840@tom.rz.uni-passau.de>
Organization: Dept. of Computer & Information Science, University of Oregon,
	Eugene, OR

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.

   Tschuess,
		   Joern

Of course, if you are a Prolog fanatic, you might say it's like discovering
that you have been facing backwards all these years.  It still takes some
time to adjust to turning around, but you'll be happier and more efficient 
when you are used to it :-)

JC

--

John Conery			Dept of Computer and Information Science
conery@cs.uoregon.edu		University of Oregon
(503) 346-4408			Eugene, OR  97403-1202
Newsgroups: comp.lang.prolog
From: baier@forwiss.uni-passau.de (Joern Baier)
Subject: Re: Need help with prolog
Organization: University of Passau, Germany
Date: Sat, 26 Sep 1992 17:56:23 GMT

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?  I'm using the 2nd edition of Bratko for a text,
>but seem to be having an exeptionally difficult time with the "declarative"
>concepts behind everything.  I used to think I was a decent programmer...

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.
So be patient and go on even though your first tries may end in the trench
besides the road.
I think it would be much easier learning PROLOG without any knowledge of other
languages.

>- Chris

Tschuess,
		Joern
-- 
* Joern Baier     (baier@forwiss.uni-passau.de) __o   *
* Jesuitengasse 9, D-W8390 Passau             _`\<,_  *
* Tel +49/851/35239                          (_)/ (_) *
From: csa09@seq1.keele.ac.uk (Paul Singleton)
Newsgroups: comp.lang.prolog
Subject: Re: Writing portable code.
Date: 29 Sep 92 00:57:33 GMT
Organization: Keele University, England

From article <ALBERTO.92Sep28113506@karna.cs.umd.edu>, by alberto@cs.umd.edu (Jose Alberto Fernandez R):

> One way to solve this is to use in the code macro commands that
> expand to the right thing for each system. Assume that your
> distributed source code is in files with extensions `.pli'. 
> In your case, the macro definitions look something like this:
> 
> 	#ifdef SEPIA
> 	#define RETRACTALL(x) retract_all(x)
> 	#else
> 	#define RETRACTALL(x) retractall(x)
> 	#endif
> 
> and in your code you use the macro RETRACTALL(x):
> 
> 	...:- ..., RETRACTALL(foo(X,Y)), ....
>... 
> It would be nice if a facility like this would have been provided as
> part of the language. Then we wouldn't need to borrow tools from 'C'.

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?  
----
  __   __    Paul Singleton (Mr)           JANET: paul@uk.ac.keele.cs
 |__) (__    Computer Science Dept.        other: paul@cs.keele.ac.uk
 |  .  __).  Keele University, Newcastle,    tel: +44 (0)782 621111 x7355
             Staffs ST5 5BG, ENGLAND         fax: +44 (0)782 713082
Newsgroups: comp.lang.prolog
From: chik@icot.or.jp (Takashi Chikayama)
Newsgroups: comp.lang.prolog
Subject: distfix and parentheses (was: postfix operators - does anyone need them?)
Date: 1 Oct 92 03:21:59 GMT
	<CHIK.92Sep22103654@ss38.icot.or.jp>
	<1992Sep30.205620.5130@quintus.com>
Reply-To: chikayama@icot.or.jp
Organization: Institute for New Generation Computer Technology, Tokyo, Japan.

In article <1992Sep30.205620.5130@quintus.com>
	pds@quintus.com (Peter D. Schachte) writes:

 |The advantage of a formalized distfix syntax extension is the same as
 |the advantage of formalized bracketing:  error detection.

Their merits are not limited to error detection.

 |For example,
 |if you wanted to add if-then-elseif-then-else-endif syntax to Prolog,
 |you could declare each of these words as an operator of the appropriate
 |precedence.

But no precedence selection can make nested if-then-else-endif valid,
as "then" and "else" cannot be declared "yfy".  On the other hand,
this can be made possible by making "if-endif" as a parentheses pair,
or probably by distfix.  In general, they give more freedom to syntax
design.

My point is that the principal difference between distfix and
parentheses is in error detection, not in the extent of such added
freedom.  As parse time error detection cannot be perfect anyway, I
think introducing parentheses would be enough.

Takashi Chikayama
ICOT
Organisation: ECP-Paris France
Date: Friday, 2 Oct 1992 20:27:05 EDT
From: <COMTET@FRECP12.BITNET>
Newsgroups: comp.lang.prolog
Subject: Comprehensive understanding of logic languages

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 :
logic of the first order
Horner's clause ( or assertion)
Could somebody give me either the meaning of those words or give me references
about suchsubjects (books or articles)?
Also could somebody send me samples of programs in Prolog not too complicated
that deal with articial intelligence or demonstration of mathematical propertie
s?

Gilles Comtet_Varga
Ecole Centrale Paris
Gde Voie des Vignes
92295 CHATENAY-MALABRY Cedex
FRANCE

COMTET at FRECP12.BITNET
Newsgroups: comp.lang.prolog
From: goldsmig@cgsvax.claremont.edu
Subject: Re: sublists
Organization: The Claremont Graduate School
Date: 29 Sep 92 11:24:58 PST

Do you mean to treat each of the elements in the sublists, no matter 
how deeply nested, in the same light?  In that case, it would seem
that something like:
remove(Rem,[H|T],[Rem_head|T_rest]):-
  H=..[.,_,_], %test to see if it is a list itself
  remove(Rem,H,Rem_head),
  remove(Rem,T,T_rest).
would take care of the cases where you ran into a sublist.
In article <1992Sep21.185751.10980@ucselx.sdsu.edu>, maxc0251@ucselx.sdsu.edu (sharon goldman) writes:
>  I am working on a program to delete elements from a list. My problem
> is that if the list contains sublists, it won't work.  I have tried
> using the predicate atom(Head) and deleting elements from the sublist
> that way, but then i have trouble appending those results onto the rest
> of the list.
> 
> any ideas??
> .
> 
Newsgroups: comp.lang.prolog
From: baier@forwiss.uni-passau.de (Joern Baier)
Subject: Another Quintus PROLOG problem
Organization: University of Passau, Germany
Date: Mon, 28 Sep 1992 13:26:08 GMT

Hi!

I am still trying to find out why several library files in Quintus PROLOG
cannot be consulted successfully. Apparently some C-sources are missing.

Desperately seeking for help!!!!!!!!!!

Joern

------------------------------Cut here!-------------------------------------
gandalf:~/prolog/dp 107> prolog

Quintus Prolog Release 2.5.1 (DECstation 3100, Ultrix 3.1)
Copyright (C) 1990, Quintus Computer Systems, Inc.  All rights reserved.
1310 Villa Street, Mountain View, California  (415) 965-7700
[consulting /home/forwiss/baier/prolog.ini...]
[prolog.ini consulted 0.033 sec 468 bytes]

| ?- [library(files)].
[consulting /private/projects/quintus/generic/qplib2.5.1/library/files.pl...]
 [consulting /private/projects/quintus/generic/qplib2.5.1/library/basics.pl...]
 [basics.pl consulted in module basics 0.150 sec 1,712 bytes]
 [consulting /private/projects/quintus/generic/qplib2.5.1/library/errno.pl...]
 [errno.pl consulted in module errno 0.516 sec 11,804 bytes]
 [consulting /private/projects/quintus/generic/qplib2.5.1/library/types.pl...]
 [types.pl consulted in module types 0.633 sec 12,668 bytes]
 [compiling /private/projects/quintus/generic/qplib2.5.1/library/eaccess.pl...]
ld:
Undefined:
getgroups
[ERROR: Foreign interface, call to Unix "ld" failed (error 413)]
  [Loading of foreign files NOT completed]
 [eaccess.pl compiled 0.100 sec 580 bytes]
ld:
Undefined:
saccess
[ERROR: Foreign interface, call to Unix "ld" failed (error 413)]
 [Loading of foreign files NOT completed]
[files.pl consulted in module files 2.267 sec 36,580 bytes]

yes
| ?- 
-- 
* Joern Baier     (baier@forwiss.uni-passau.de) __o   *
* Jesuitengasse 9, D-W8390 Passau             _`\<,_  *
* Tel +49/851/35239                          (_)/ (_) *
From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
Subject: Re: retract*all
Organization: Computer Science, University of Melbourne, Australia
Date: Thu, 1 Oct 1992 06:18:27 GMT

cduguay@lcraft.ersys.edmonton.ab.ca (Claude Duguay) writes:

>This may seem silly 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?

The problem is a general one, so we want a general solution.
retract_all is just one example, there are undoubtably many others.

Also a user's implementation of retract_all may be much less efficient than
the built-in implementation.

-- 
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!
From: kilpelai@cs.Helsinki.FI (Pekka Kilpelainen)
Newsgroups: comp.lang.prolog
Subject: Re: Occur check
Date: 29 Sep 92 12:57:31 GMT
Distribution: comp
Organization: University of Helsinki, Finland

In <PETER.92Sep25113017@bax.infko.uni-koblenz.de> peter@infko.uni-koblenz.de (Peter Baumgartner) writes:

>I have a question concerning the occur-check. Does anybody know of
>sufficent and (preferrably) statically checkable conditions to be
>imposed on a set of clauses (Horn clauses or 1st order clauses), which
>guarantee that the occur check need not be carried out during a
>resolution proof?

The following recent paper may provide answers to your question,
although I believe that its emphasis is more on Prolog as programming 
language than on general resolution logic.

	K. R. Apt and A. Pellegrini: Why the occur-check is not a
	problem. In PLILP'92 Proceedings, pages 69-86, Springer-Verlag
	LCNS 631.

Yours,


Pekka Kilpela"inen   University of Helsinki    kilpelai@cs.helsinki.fi
                     Dept. of Comp. Sci.       *-358-0-7084227
-- 
Pekka Kilpel\"{a}inen   University of Helsinki    kilpelai@cs.helsinki.fi
                        Dept. of Comp. Sci.       *-358-0-7084227
From: arjen@disnet.uucp (Arjen Duursma)
Newsgroups: comp.lang.prolog
Subject: Re: How to cleanup side effects after cut?
Keywords: cut, side effects, rewriting clauses
Date: 28 Sep 92 06:59:26 GMT
Organization: Disnet, IDE Maassluis, The Netherlands

ludemann@quintus.com (Peter Ludemann) writes:

>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.

So define:

oncegoal :-
	(sideeffects,somegoal,undosideeffects);(undosideeffects,othergoal),!.

and use: ?- oncegoal.

>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.)

What you need is a good description of the use of the predicate you want
to use. This description may tell you that have to use two predicates,
one to make the mess (produce the answers) and one to clean things up.

Just like: see/1 and seen/0, tell/1 and told/0.

Any answers to the question that started this discussion is quite
useless until there is a good description of what the predicate should
do. The answer depends on the question.

Anyway, I am still far from convinced that any special predicates to
implement the requested funcionality. Just some experience in working
with prolog.

>-- 
>	Peter Ludemann  +1-415-813-3800  ludemann@quintus.com

Arjen