|
|
1.1 root 1: .ND
2: .nr LL 75n
3: .nr LT 80n
4: .rm CF
5: .ds LH PEARL Documentation
6: .ds CH Update
7: .ds RH Page %
8: .po 1.50i
9: .ls 1
10: .hy 14
11: .LP
12: .bp 76
13: .DS C
14: .LG
15: \fBUpdate of Changes
16: Through
17: PEARL 3.9
18: April 1983\fR
19: .SM
20: .DE
21: .SH
22: 1. Introduction
23: .PP
24: This appendix describes the changes that have been made to PEARL since
25: the original manual was produced.
26: It is designed to parallel the sections of the manual so that the
27: original index can be used to find changes.
28: .PP
29: PEARL is now distributed with Franz Lisp (starting with Opus 38.58).
30: The earliest version of PEARL distributed (with 38.58) was PEARL 3.6.
31: The current update corresponds to version 3.9 and is being distributed
32: with the Franz Opus 38.69 available with 4.2 BSD Unix.
33: The current major and minor version numbers for PEARL are stored in
34: the special variables \fIpearlmajorversion\fR and \fIpearlminorversion\fR
35: respectively.
36: .PP
37: With the change in mail protocols and addition of new machines at
38: Berkeley, the form of addresses for bugs and suggestions have been
39: simplified.
40: Bugs, suggestions or queries should be sent to
41: \fIPearl\-Bugs@Berkeley\fR or \fIucbvax!pearl\-bugs\fR.
42: .SH
43: 2. Running PEARL
44: .PP
45: PEARL is currently only maintained under Franz Lisp.
46: The current version could be moved back to UCI Lisp (or to other
47: Lisps) fairly easily but has not been for lack of need.
48: Lisp Machine Lisp is the most likely Lisp that PEARL will be moved
49: to next but it has not been done, mostly because of conflicts in the
50: use of the colon character and lack of access to a Lisp Machine.
51: .SH
52: 2.1 Under Franz Lisp
53: .PP
54: Since PEARL is now part of Franz Lisp, it should be available as
55: \fI/usr/ucb/pearl\fR or wherever you find \fIlisp\fR on your system.
56: .PP
57: The \fI.start.pearl\fR and \fI.init.pearl\fR files are actually
58: called \fIstart.prl\fR and \fIinit.prl\fR and may optionally be
59: prefixed with a dot "." and/or suffixed with either ".o" or ".l" just
60: as in Franz.
61: The use of the dot prefix and of the ".o" or ".l" is preferred
62: and fastest.
63: Thus PEARL will read the first file found in the following
64: sequence: \fI.init.prl.o\fR, \fI.init.prl.l\fR, \fI.init.prl\fR,
65: \fIinit.prl.o\fR, \fIinit.prl.l\fR, or \fIinit.prl\fR and similarly
66: for \fIstart.prl\fR.
67: Franz's special variable \fI$ldprint\fR is lambda-bound to \fInil\fR during
68: the reading of these two files to disable the printing of
69: "[load .init.prl]".
70: .SH
71: 5. Accessing Slots of Structures
72: .PP
73: Doing a "\fIpath \fBput\fR" on a slot containing a variable will
74: not set the variable.
75: Rather it replaces the variable with the value provided.
76: .SH
77: 10. Printing Structures, Symbols and Other PEARL Objects
78: .PP
79: The various printing functions still exist but all call a single
80: formatting function with various options controlled by special atoms.
81: The principle functions are \fBallform\fR which does the building of a
82: printable list form for internal PEARL structures and \fBallprint\fR
83: which calls \fIallform\fR.
84: \fIAllform\fR uses the following global variables to determine what
85: form to build:
86: .IP 1.
87: \fB*abbrevprint*\fR -- a non-\fInil\fR value causes abbreviations
88: to be used whenever possible for any structure except the top level
89: structure passed to a print function.
90: Abbreviations are described at the end of this section.
91: The new functions \fBabbrevform\fR and \fBabbrevprint\fR
92: lambda-bind this to \fIt\fR and then call \fIallform\fR.
93: \fIfullform\fR binds this to \fInil\fR.
94: .IP 2.
95: \fB*fullprint*\fR -- a non-\fInil\fR value causes complete information
96: including hooks and predicates to be given when present.
97: \fIFullform\fR (and thus \fIfullprint\fR) lambda-binds this to \fIt\fR
98: and calls \fIallform\fR.
99: \fIAbbrevform\fR binds this to \fInil\fR.
100: .LP
101: \fIValform\fR lambda-binds both to \fInil\fR.
102: The default value of both is are also \fInil\fR, so that the default action of
103: \fIallform\fR when used by itself will be like \fIvalform\fR unless these
104: special variables are changed.
105: All the default print functions automatically use \fIallprint\fR so that
106: they can all be changed by changes to the default values of
107: \fI*abbrevprint*\fR and \fI*fullprint*\fR.
108: .LP
109: Two other special atoms which affect the behavior of all the printing
110: functions are:
111: .IP 3.
112: \fB*uniqueprint*\fR -- a non-\fInil\fR value causes a structure which is
113: encountered more than once during the same top-level call to a
114: print function to be translated into exactly the same cons-cells.
115: This saves on cons-cells and also makes it possible for the \fI\-\-form\fR
116: functions to handle circular structures, although \fIsprint\fR and thus
117: the \fI\-\-print\fR functions cannot handle the result.
118: Since most people seldom have duplications within a structure,
119: the default is \fInil\fR (off).
120: The assoc\-list of already translated structures is stored in the
121: special atom \fB*uniqueprintlist*\fR.
122: .IP 4.
123: \fB*quiet*\fR -- a non-\fInil\fR value disables all printing by any of
124: PEARL's print functions, providing an easy way to disable printing
125: all at once.
126: There is also a function called \fBquiet\fR which behaves like
127: \fIprogn\fR, except that it lambda-binds \fI*quiet*\fR to \fIt\fR
128: during the evaluation of its arguments, providing a local island
129: of "quiet".
130: .PP
131: The standard print functions are designed to handle any Lisp structure.
132: Thus, they spend a significant amount of time determining what kind of
133: object they have been passed.
134: For situations in which you know exactly what type of object you want
135: printed, the functions
136: \fBstructureform/structureprint\fR, \fBsymbolform/symbolprint\fR,
137: and \fBstreamform/streamprint\fR are provided.
138: They assume you know what you are doing and do not ensure that
139: you give them the right type of value.
140: .PP
141: Adapting PEARL to fit an improvement in Franz, the atoms
142: \fIshowstack-printer\fR and \fItrace-printer\fR are bound to
143: the functions \fBpearlshowstackprintfn\fR and \fBpearltraceprintfn\fR.
144: \fBNote\fR the addition of "pearl" to the beginning of these.
145: The name of \fIbreakprintfn\fR was also changed to
146: \fBpearlbreakprintfn\fR but it is not currently lambda-bindable.
147: .SH
148: 10.1. Abbreviations
149: .PP
150: As people build larger deeper structures it becomes useful to have
151: some of them abbreviated during printing if they are internal to the
152: structure being printed.
153: When an individual (including default instance) structure is created,
154: an abbreviation atom is stored in it.
155: This abbreviation is chosen as follows:
156: .IP 1.
157: If the option in \fIcreate\fR of having a structure automatically
158: stored in an atom is used, then that atom is the one used as an
159: abbreviation.
160: Thus the structure created by \fI(create individual x Pete)\fR will
161: be given the abbreviation \fIPete\fR.
162: .IP 2.
163: If that option is not used, then default instances will be
164: given the abbreviation \fIi:x\fR (where x is the structure type name)
165: and individuals at the top level will be given a name \fInewsym\fR-ed
166: from the name of their type.
167: Thus \fI(create base x)\fR will make a default instance abbreviated
168: \fIi:x\fR and the first structure created with \fI(create individual x)\fR
169: will be abbreviated \fIx0\fR.
170: .IP 3.
171: \fIScopy\fR and related functions that create new structures from old
172: ones \fIgensym\fR the new structure's abbreviation from that of the
173: old structure.
174: .SH
175: 11. Error Messages, Bugs, and Error Handling Abilities
176: .PP
177: Bugs, complaints and suggestions of useful features (to be added to
178: the current list of 30 or so things on the wish list) should be
179: mailed by electronic mail to \fBPearl\-Bugs@Berkeley\fR or
180: \fBucbvax!pearl\-bugs\fR.
181: .SH
182: 12. Short-Circuiting and Redirecting Create Using !, $ and Atoms
183: .PP
184: If an atom is encountered where a value-description was expected in
185: any type of slot, and it is bound to a value of the right type,
186: its value is inserted into the slot.
187: For \fIsymbols\fR, this is done if the atom is not a symbol name.
188: For \fIstructures\fR, the atom must evaluate to a structure.
189: For \fILisp\fR slots, it must simply be bound.
190: For \fIsetof\fR slots, its value is checked for being of the appropriate
191: type, including depth of nesting.
192: .PP
193: Note also that a change in the internal representation has made it possible
194: to allow \fBeven atoms\fR in slots of type \fIlisp\fR.
195: .SH
196: 13. More Flexible Hash Selection
197: .PP
198: Because we have never gotten around to adding fetch functions to take
199: advantage of colon and colon-colon hashing and these two methods
200: really are not useful in normal fetching, they are currently ignored.
201: .PP
202: For situations in which you wish to create an expanded structure and
203: add new hashing marks to an old slot (rather than replace them),
204: preceding new hash marks with a plus ("+") will cause the old
205: hashing information to be copied before processing the new hashing.
206: .PP
207: Thus, the sequence
208: .DS
209: (cb x (* a int))
210: (ce x y (a ^))
211: (ce x z (+ : a ^))
212: (ce x w (: + a ^)) ; anomalous use of +
213: .DE
214: will result in:
215: .DS
216: * hashing in x,
217: no hashing in y,
218: both * and : hashing in z, and
219: only * hashing in w (because of misplacement of +).
220: .DE
221: .PP
222: Several new hashing methods have been added to PEARL.
223: .PP
224: A hashing mechanism using the label \fB***\fR has been added called
225: "triple-star hashing".
226: If slots are labeled with *** and \fBall\fR slots so marked are filled
227: with useful values, then the item is hashed under the type of structure
228: plus the values of all these slots.
229: During fetching, this is considered the most useful (that is,
230: specific) hash method.
231: .PP
232: A hashing mechanism using the label \fB&&\fR has been added called
233: "hash focusing".
234: It is designed for people using a data base all of
235: whose entries are of the same type (not required, just common
236: for this application) and enables the contents of a single slot
237: to be used to better discriminate them.
238: Examples of such structures are "planfors", inference rules,
239: or almost any other such extremely-common binary predicates.
240: If a slot labeled && is found when inserting into the database then
241: the item is hashed as if it were the item in the slot so labeled.
242: At fetching time, && is considered less useful than *** or **
243: and more useful than * or nothing.
244: .PP
245: This differs from & (hash aliasing) in that hash focusing
246: affects how a structure itself is inserted and fetched, while
247: & simply affects how structures containing this type of
248: structure are treated.
249: For example, suppose the unique numbers of A, B, and C
250: respectively are 1, 2, and 3.
251: C is a symbol.
252: A has one slot X with * and && hashing.
253: B has one slot Y of type symbol with * hashing.
254: Then a structure like (A (X (B (Y C)))) will be indexed the
255: following ways and \fIfetcheverywhere\fR (see below) will find
256: it in the following order: the && method will be used first
257: which uses the 2 and 3 from B and its C, (ignoring the 1 of A),
258: and also simply 2 from B;
259: the * on A uses the type of B thus using 1 and 2;
260: it is also looked for under the 1 of A without using 2 or 3.
261: If B had an & in its slot then the * on A is affected by & on B thus
262: using 1 and 3 (ignoring the 2 of B).
263: .PP
264: Thus, if you consider A, B, and C to be three levels of information
265: in the structure, an item can be hashed under any combination of two
266: of those levels.
267: The normal * method uses levels 1 and 2,
268: the aliasing & method ignores level 2 and uses levels 1 and 3,
269: and the new focussing && method ignores level 1 and uses levels 2 and 3.
270: In addition, the item can be put under 1, 2 or 3 individually by
271: various combinations of marks (1 = none, 2 = :, 3 = :+&).
272: The only unavailable combination of the three is all of them.
273: .SH
274: 16. Attaching Hooks to Structures (If-Added Demons)
275: .PP
276: Slot hooks are now always inherited and added to, rather than replaced.
277: If the hooks and predicates of a slot are preceded by \fBinstead\fR
278: then inheriting does not happen and hooks and predicates are replaced.
279: .PP
280: The atoms for path hooks were misnamed in such a way that you could not
281: use \fIhidden\fR and \fIvisible\fR.
282: Instead of \fI*rungethooks*\fR, and other \fI*run...hooks*\fR forms,
283: they are now \fB*rungetpathhooks*\fR and other \fB*run...pathhooks*\fR.
284: Note that they must be called as (\fIXXX\fRpath ...) and not
285: (path\ \fIXXX\fR ...) when used with \fIhidden\fR and \fIvisible\fR.
286: .SH
287: 17. Creating and Manipulating Multiple Data Bases
288: .PP
289: The function \fIsetdbsize\fR can now be done at any time and
290: will remove all current databases before changing the size,
291: warn the user (if \fI*warn*\fR is set) and recreate \fI*maindb*\fR
292: with the special variable \fI*db*\fR pointing to it.
293: .PP
294: The function \fIcleardb\fR is now a local database clearer
295: and its effects do not extend up the database hierarchy.
296: .SH
297: 19. Creating Expanded Subtypes of Previously Defined Objects
298: .PP
299: Hashing in old slots inherited by new expanded structures can now be
300: added to by preceding the new hash marks with plus ("+").
301: See section 13 above.
302: .PP
303: The name of an old slot inherited by a new expanded structure may be
304: changed by following the new name by the old slotname preceded with
305: an equal sign.
306: Thus for example:
307: .DS
308: pearl> (create base X (A struct))
309: (X (A (nilstruct)))
310: pearl> (create expanded X Y (B =A) (C .....))
311: (Y (B (nilstruct)) (C .....)))
312: .DE
313: Note that there may not be a space between the equal sign and the slot
314: name since \fI=\fR is a read macro which expands \fI=A\fR into
315: \fI(*slot* A)\fR but leaves a single space-surrounded equal sign alone.
316: The actual effect is to add another name to the slot so that it can be
317: later referenced with either name.
318: .SH
319: 20. Fetching Expanded Structures
320: .PP
321: A fetching function called \fBfetcheverywhere\fR exists which gathers
322: \fBall\fR the buckets the object could have been hashed into and
323: builds a stream out of all of them (potentially five buckets).
324: There is currently no "expanded" counterpart, since it has the potential
325: of returning \fI5 times the-depth-of-the-hierarchy\fR buckets.
326: .SH
327: 21.2 The Matching Process
328: .PP
329: During matching, if an unbound global variable is set and
330: the match later fails, the value is restored to \fI*pearlunbound*\fR.
331: The names of variables that are set are saved in the special variable
332: \fB*globalsavestack*\fR.
333: .PP
334: Formerly, there was only one match function which was used by both
335: \fIstandardfetch\fR and \fIexpandedfetch\fR and which therefore would
336: match two structures if they were hierarchically related.
337: This is really inappropriate for the standard fetching, so
338: there are now two regular match functions, \fIstandardmatch\fR and
339: \fIbasicmatch\fR, which will only match two structures of the same type,
340: and two expanded match functions, \fIstandardexpandedmatch\fR and
341: \fIbasicexpandedmatch\fR, which will match two structures which are
342: related hierarchically (one above the other) on the slots they have
343: in common.
344: Streams built by \fIstandardfetch\fR use the regular versions and
345: and streams built by \fIexpandedfetch\fR use the expanded versions.
346: .PP
347: There are now two functions \fBmemmatch\fR and \fBmemstrequal\fR which
348: are like \fImemq\fR except that they use \fImatch\fR and \fIstrequal\fR
349: respectively instead of \fIeq\fR.
350: .PP
351: As of version 3.8, PEARL will now do \fBunification\fR of variables in
352: pattern matching.
353: To turn it on, call the function \fBuseunification\fR.
354: (The current implementation precludes turning it off once it is on but
355: this may be remedied in later versions if we can figure out what it
356: means to stop unifying.)
357: .SH
358: 26. Looping and Copying Functions
359: .PP
360: The function \fIscopy\fR no longer deletes bound adjunct variables.
361: .PP
362: The standard Franz function \fIcopy\fR is no longer redefined since
363: the standard version now avoids the copying of hunks.
364: .PP
365: The functions \fIscopy\fR and \fIpatternize\fR are now exprs rather
366: than macros.
367: .PP
368: The new function \fBvarreplace\fR permanently "freezes" the values
369: of slots containing bound variables by replacing all bound variables
370: in an item with their values.
371: .PP
372: A variation on \fIscopy\fR called \fBintscopy\fR ("internal scopy")
373: is designed to do the copying as if the copied item were internal to
374: another outer item, thus sharing its local and block variables.
375: Its arguments are the item to be copied and the outer item in whose
376: scopy the copying should be done.
377: .SH
378: 29. Appendix of UCI Lisp functions added to Franz PEARL
379: .PP
380: The definitions of \fIde\fR, \fIdf\fR, \fIdm\fR, \fIdrm\fR and \fIdsm\fR
381: have been modified so that if the special variable \fB*savedefs*\fR
382: is \fInil\fR then old definitions of functions are not saved.
383: This is especially useful in compiling (and as a result, assembly
384: and loading) since it will speed them up quite a bit.
385: This also disables the saving of the name of the file that the
386: definition was in.
387: The variable \fI*savedefs*\fR is normally \fIt\fR which causes these
388: macros to act as before, saving the definition, etc.
389: If \fI*savedefs*\fR is \fInil\fR, then they simply expand into the
390: appropriate \fIdefun\fR or \fIsetsyntax\fR.
391: The following lines should be included in a file to have this effect
392: only at compile time:
393: .DS
394: (eval-when (compile)
395: (declare (special *savedefs*))
396: (setq *savedefs* nil))
397: .DE
398: .LP
399: If you also want to permanently disable this feature in a lisp, that
400: loads \fIucisubset.l\fR, simply put a \fI(setq *savedefs* nil)\fR
401: in your \fI.lisprc\fR file AFTER the loading of \fIucisubset.l\fR.
402: .PP
403: The function \fIremove\fR is no longer made equivalent to Franz's
404: \fIdelete\fR so that Franz's \fIremove\fR can be used.
405: The functions \fInth\fR, \fIpush\fR and \fIpop\fR are no longer
406: defined by PEARL, since the new Franz versions are better.
407: (UCI Lisp users note: This switches the arguments to \fIpush\fR.)
408: .SH
409: 32. Index of Global Variables and Functions With Their Arguments
410: .PP
411: All special variables in PEARL are now defined with \fIdefvar\fR so
412: that \fIfasl\fR'ing in \fIpearl.o\fR at compile time will automatically
413: declare them special again.
414: .PP
415: All the exprs whose names were of the form \fIXXXX1\fR where
416: \fIXXXX\fR was the name of a lexpr which was a principle function
417: of PEARL were eliminated (i.e., absorbed by the other form).
418: .SH
419: 34. Compiling Lisp+PEARL Files.
420: .PP
421: To compile a file of mixed Lisp and PEARL functions with \fIliszt\fR,
422: you must first load in the function definitions and special
423: declarations of PEARL by loading the object code.
424: This is the file \fIpearl.o\fR which is normally kept in the
425: \fI/usr/lib/lisp\fR directory and will found automatically by
426: \fIload\fR.
427: .PP
428: Thus, the following should normally be included at the
429: beginning of a PEARL file you wish to compile:
430: .DS
431: (eval-when (compile)
432: (declare (special defmacro-for-compiling))
433: (setq defmacro-for-compiling t)
434: (load 'pearl.o))
435: (declare (macros t))
436: .DE
437: .rm CF
438: .rm LH
439: .rm CH
440: .rm RH
441: .bp
442: .DS C
443: .LG
444: \fBUpdate of Changes
445: Through
446: PEARL 3.9
447: April 1983
448: .sp 1
449: Table of Contents\fR
450: .SM
451: .DE
452: .DS L
453: 1. Introduction \ka76
454: 2. Running PEARL \h'|\nau'76
455: 2.1. Under Franz Lisp \h'|\nau'76
456: 5. Accessing Slots of Structures \h'|\nau'76
457: 10. Printing Structures, Symbols and Other PEARL Objects \h'|\nau'76
458: 10.1. Abbreviations \h'|\nau'77
459: 11. Error Messages, Bugs, and Error Handling Abilities \h'|\nau'78
460: 12. Short-Circuiting and Redirecting \fICreate\fR Using !, $ and Atoms \h'|\nau'78
461: 13. More Flexible Hash Selection \h'|\nau'78
462: 16. Attaching Hooks to Structures (If-Added Demons) \h'|\nau'79
463: 17. Creating and Manipulating Multiple Data Bases \h'|\nau'80
464: 19. Creating Expanded Subtypes of Previously Defined Objects \h'|\nau'80
465: 20. Fetching Expanded Structures \h'|\nau'80
466: 21.2 The Matching Process \h'|\nau'80
467: 26. Looping and Copying Functions \h'|\nau'81
468: 29. Appendix of UCI Lisp functions added to Franz PEARL \h'|\nau'81
469: 32. Index of Global Variables and Functions With Their Arguments \h'|\nau'81
470: 34. Compiling Lisp+PEARL Files \h'|\nau'82
471: .DE
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.