Copy Link
Add to Bookmark
Report

AIList Digest Volume 4 Issue 135

eZine's profile picture
Published in 
AIList Digest
 · 11 months ago

AIList Digest            Tuesday, 3 Jun 1986      Volume 4 : Issue 135 

Today's Topics:
Queries - OPS5 in PSL & Dempster-Shafer Scoring Rules &
Formal Definition of Lisp Systems & Lazy Evaluation,
Techniques - Common Lisp style

----------------------------------------------------------------------

Date: 29 May 86 19:05:27 GMT
From: mcvax!botter!klipper!fons@seismo (Fons Botman)
Subject: OPS5 in PSL request

I am looking for an OPS5 implementation in PSL.
Please mail any pointers or source to: Kievit@Hlerul5.Bitnet

For a friend
Fons Botman
fons@vu44.UUCP

------------------------------

Date: 30 May 86 01:33:15 GMT
From: kaist!cskaist!mgchung@seismo ([Mingyo Chung])
Subject: Search for scoring rules paper!


To. everyone who can give me a help......

I have broadcast this message for asking a favor. "Interval (or Range)
Extension of Reproducing-Scoring-Rule by Dempster and Shafer's Rule"
is my
Master thesis. Thus, I seek for papers on "scoring rules" and have found out
a paper that seems to be related with "scoring rules".By the way, that paper
is not found in Korea.That paper is as follows ::

Lindley, D.V. (1982),"Scoring rules and the inevitability of probability",
International Statistics Review,vol 50, 1-26

Do you have this paper ? Then, would you mind giving me a help ?
Would you please send me a copy of it ?

You can contact me through electronic mail
[Path:mgchung%cskaist%kaist.csnet@CSNET-RELAY]
[Address:
Mingyo Chung
Dept. of Computer Science KAIST
P.O Box 150
CheongRyang
Seoul Korea 131 ]

I'll be waiting for a good response ....


Sincerely Yours.

------------------------------

Date: 5 Jun 86 20:03:44 GMT
From: allegra!mit-eddie!think!caip!seismo!mcvax!euroies!rreilly@ucbvax
.berkeley.edu (Dr Ronan Reilly)
Subject: Formal definition of Lisp systems

Does anyone have references to a system which could be used to
formally define large Lisp program suites? What I have in mind
is something akin to the dataflow system for procedural languages.

Thanks in advance,

Ronan

------------------------------

Date: Mon, 2 Jun 86 09:27 N
From: DESMEDT%HNYKUN52.BITNET@WISCVM.WISC.EDU
Subject: Lisp & lazy evaluation

In AIList Digest V4 #134, Mike Maxwell reluctantly prefers the efficiency
of a hand-coded "do" construction in Lisp, although mapping a function on
a list would be more elegant. Indeed, mapping sometimes causes many
unnecessary computations. Consider the following example:

(defun member (element list)
(apply 'or (mapcar #'(lambda (list-element)
(eql element list-element))
list)))

One solution to prevent wasteful computation is a "lazy" evaluation mechanism,
which computes only as much as is needed by other computations. For example,
the mapping in the above example would be performed only up to the point where
"or" finds a non-nil value and doesn't want to evaluate any more arguments.

Anyway, I don't really want to lecture here, but I want to ask a question:
has anyone out there experimented with lazy evaluation in a Lisp system?
Are any working systems (or prototypes) available? Any good references to
the literature?

Koenraad de Smedt desmedt@hnykun52.bitnet

------------------------------

Date: 29 May 86 15:20:04 GMT
From: allegra!princeton!caip!seismo!ut-sally!utah-cs!shebs@ucbvax.berkeley
.edu (Stanley Shebs)
Subject: Re: Common LISP style standards.

In article <545@bcsaic.UUCP> michaelm@bcsaic.UUCP (michael maxwell) writes:

>I'm in a little different boat, since we're using Franz rather than Common
>Lisp

I remember Franz (vaguely)... :-)

>A common situation we find ourselves in is the following. We have a list,
>and we wish to apply some test to each member of the list. However, at some
>point in the list, if the test returns a certain value, there is no need to
>look further: we can jump out of processing the list right there, and thus
>save time.

Common Lisp provides "some", "every", "notany", and "notevery" functions
which all do variations of what you're asking for. They take a predicate
and one or more sequences as arguments, and apply the predicate to each
element in the sequence, and may stop in the middle. The behavior is
sufficiently specified for you to use side effects in the predicate.
BTW, if these four functions weren't around, Common Lisp would be smaller.

>I suppose I could use "catch" and "throw", but that looks so much like "goto"
>that I feel sinful if I use that solution...

"Sinfulness" is a silly concept that quite a few folks in the computer
community have gotten into - a sort of aftereffect of structured programming.
The *real* reason for using higher-level constructs is efficiency, both
in programmer and execution time.

stan shebs
utah-cs!shebs

------------------------------

Date: Sat, 31 May 1986 11:23 EDT
From: "Scott E. Fahlman" <Fahlman@C.CS.CMU.EDU>
Subject: Common Lisp style


A common situation we find ourselves in is the following. We have a
long list, and we wish to apply some test to each member of the list. ...
Any style suggestions?

Well, if you were using "Monster, I mean Common, Lisp..." there would be
a built-in function to handle this case. If I understand correctly what
you are asking for, the function is FIND-IF. Our attempt to meet
various needs like this is why the language is big. You can't have it
both ways.

In a Lisp without a built-in solution, the right answer is probably to
create your own FIND-IF macro and use it for this case. It creates the
same DO-loop you would have to write, but is much less confusing for the
casual reader and less prone to errors once you get the macro right.

If you find yourself wrestling with a variety of such problems, there
are several iteration packages available that provide a somewhat
perspicuous syntax for the user and that create efficient DO loops of
various kinds. Your Franz Lisp vendor can probably point you to a
version of the LOOP facility that will run on your system. Something of
this sort will probably find its way into standard Common Lisp
eventually, but we are having a hard time deciding on a syntax that we
all can live with.

-- Scott

------------------------------

Date: 1-Jun-86 14:52:27
From: Dan Cerys <Cerys%TILDE%ti-csl.csnet@CSNET-RELAY.ARPA>
Subject: Re: Common LISP style standards


Date: 15 May 86 17:42:18 GMT
From: tektronix!uw-beaver!ssc-vax!bcsaic!michaelm@ucbvax.berkeley.edu
(michael maxwell)

A common situation we find ourselves in is the following. We have a
long list, and we wish to apply some test to each member of the list. ...

It sounds like the function you want is MEMBER-IF. This takes two
required arguments, a predicate and a list. As soon as the predicate
succeeds on one of the elements of the list, the tail of the list is
returned, else NIL is returned.

There is nothing wrong with using DO or any of the mapping functions, as
long as you are using the "best" function for the task. In the case
you've described, MEMBER-IF is perfect because it immediately conveys to
the reader (which may be yourself months after you've written it) what
is being tested for. DOs and RETURNs can hide this meaning. Another
useful variant of DO is DOLIST, which is similar (and prefered by many)
to MAPC. Within our group, we prefer to use the mapping functions only
where they appear to be "natural" to the task (eg, list
transformations). But granted, what is "best" and "natural" depends a
lot on your background and approach to Lisp.

------------------------------

Date: 30 May 86 17:05:44 GMT
From: decvax!cca!lmi-angel!rpk@ucbvax.berkeley.edu (Bob Krajewski)
Subject: Re: Common LISP style standards.

In article <> michaelm@bcsaic.UUCP (michael maxwell) writes:
>In article <3787@utah-cs.UUCP> shebs@utah-cs.UUCP (Stanley Shebs) writes:
>>Sequence functions and mapping functions are generally preferable to
>>handwritten loops, since the Lisp wizards will probably have spent
>>a lot of time making them both efficient and correct (watch out though;
>>quality varies from implementation to implementation).

This is very true. It will be interesting to see how Lisp compiler
technology meets the challenge...

>A common situation we find ourselves in is the following. ...

There are two Common Lispy ways doing this. The first is the use the
function (SOME predicate sequence &rest more-sequences), which returns the
first non-NIL result of the application of the predicate to the each set of
elements of the sequences (like map). Since this is a generic sequence
function that can take either vectors or lists, you'll probably want to
write something like

(some #'(lambda (x)
(when (wonderful-p (sibling x)) (father x)))
(the list a-list))

A good compiler would do two things here: it would first notice that the
only sequence is a list. Thus, the ``stepping'' function for the sequence
type (CDR, and CAR for element selection) is known in advance. And since
that is so, it can open code the loop, thus generating a DO-like thing that
you would have otherwise written by hand.

Another way is to use CATCH and THROW. When the THROW is lexically visible
from the CATCH, very good code can be generated in certain cases. As for
whether it's icky or not, at least CATCH establishes a lexical scope for
where the ``goto'' is valid, when the THROW is visible.

--
Robert P. Krajewski
Internet/MIT: RPK@MC.LCS.MIT.EDU
UUCP: ...{cca,harvard,mit-eddie}!lmi-angel!rpk

------------------------------

Date: 1 Jun 86 17:03:30 GMT
From: allegra!princeton!caip!topaz!harvard!bu-cs!bzs@ucbvax.berkeley.edu
(Barry Shein)
Subject: Re: Common LISP style standards.


[re: Franz Lisp]

>Now you can jump out of a do loop with "(return <value>)", but you
>can't jump out of a mapc (mapcar etc.) with "return." So we wind up using
>"do" a lot of places where it would otherwise be natural to use "mapcar". I
>suppose I could use "catch" and "throw", but that looks so much like "goto"
>that I feel sinful if I use that solution...
>Mike Maxwell
>Boeing Artificial Intelligence Center

Howsabout:


(defun foo (x)
(prog nil
(mapc '(lambda (y)
(cond ((null y) (return 'DONE)) (t (print y))))

x)))

try for example (foo '(a b nil c d))

-Barry Shein, Boston University

------------------------------

Date: 2 Jun 86 17:10:26 GMT
From: hplabs!hplabsc!dsmith@ucbvax.berkeley.edu (David Smith)
Subject: Re: Common LISP style standards.

> In article <3787@utah-cs.UUCP> shebs@utah-cs.UUCP (Stanley Shebs) writes:
> >Sequence functions and mapping functions are generally preferable to
> >handwritten loops, ...
> I'm in a little different boat, since we're using Franz rather than Common
> Lisp, so perhaps the issues are a bit different ...
> Mike Maxwell

CMU incorporated functions of CMUlisp into Franz, and these are apparently
shipped with Franz: at least, on my computer, they are in
/usr/src/ucb/lisp/lisplib/cmufncs.l. One of these functions is the
function some.

(some 'mylist 'func1 'func2)

returns the first tail of mylist for which func1 of its car returns a
non-nil value. Otherwise nil is returned. Successive tails of mylist
are obtained by repeated application of func2 (usually cdr, or nil,
which implies cdr). A nice cover macro for this is "exists".
Example:
(exists i '(2 5 3 8 4 1) (> i 6))
returns (8 4 1).

David Smith
HP Labs

------------------------------

End of AIList Digest
********************

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT