document distributed with 4.2BSD
authorNick Cuccia <cuccia@ucbvax.Berkeley.EDU>
Wed, 30 Apr 1986 03:19:33 +0000 (19:19 -0800)
committerNick Cuccia <cuccia@ucbvax.Berkeley.EDU>
Wed, 30 Apr 1986 03:19:33 +0000 (19:19 -0800)
SCCS-vsn: old/lisp/fp/PSD.doc/manApp.rno 5.1

usr/src/old/lisp/fp/PSD.doc/manApp.rno [new file with mode: 0644]

diff --git a/usr/src/old/lisp/fp/PSD.doc/manApp.rno b/usr/src/old/lisp/fp/PSD.doc/manApp.rno
new file mode 100644 (file)
index 0000000..851037c
--- /dev/null
@@ -0,0 +1,302 @@
+.\" Copyright (c) 1980 Regents of the University of California.
+.\" All rights reserved.  The Berkeley software License Agreement
+.\" specifies the terms and conditions for redistribution.
+.\"
+.\"    @(#)manApp.rno  5.1 (Berkeley) %G%
+.\"
+.sx 0
+.AP "Appendix A: Local Modifications"
+.NS 1 "Character Set Changes"
+.sp
+.pp
+Backus [Ba78] used some
+characters that do not appear on our
+ASCII terminals, so  we have made the following substitutions:
+.sp 2
+.TS
+center box;
+l|c|c.
+\fBconstant\fP  $x bar$        %\fIx\fP
+\fBinsert\fP   \(sl    !
+\fBapply-to-all\fP     \(*a    &
+\fBcomposition\fP      \*(cm   @
+\fBarrow\fP    $->$    ->
+\fBempty set\fP        \(*f    <>
+\fBbottom\fP   \*(bt   ?
+\fBdivide\fP   \(di    \(sl
+\fBmultiply\fP \(mu    \(**
+.TE
+.sp
+.NS 1 "Syntactic Modifications"
+.NS 2 "While and Conditional"
+.pp
+\fBWhile\fP and conditional functional expressions
+\fImust\fP be enclosed in parenthesis, \*(EG
+.sp
+.(c
+(\fBwhile\fP \fIf g\fP)
+.sp
+(\fIp\fP \fB->\fP \fIf\fP \fB;\fP \fIg\fP)
+.)c
+.sp
+.NS 2 "Function Definitions"
+.pp
+Function definitions are 
+enclosed by curly braces; they
+consist of a name-definition pair,
+separated by blanks.  For example:
+.sp
+.ce 1
+.b "{fact$~$ !\(** @ iota}"
+.sp
+defines the function \fBfact\fP (the reader should recognize this as the
+non-recursive factorial function).
+.sp
+.NS 2 "Sequence Construction"
+.pp
+It is not necessary to  separate elements of a sequences with
+a comma; a blank will suffice:
+.sp
+.nf
+.ce 1
+<1,2,3> $==$ <1 2 3>
+.sp
+.fi
+.pp
+For nested sequences, the terminating right angle bracket
+acts as the delimiter:
+.sp
+.nf
+.ce 1
+<<1,2,3>,<4,5,6>> $==$ <<1 2 3><4 5 6>>
+.sp
+.fi
+.sp 2
+.NS 1 "User Interface"
+.sp
+.pp
+We have provided a rich set of commands that allow the user to
+catalog, print, and
+delete functions, to load them from a file and to save them away.
+The user may generate script files, dynamically trace and
+measure functional expression execution, generate debugging output,
+and, temporarily exit to the \s-2FRANZ LISP\s+2 system.
+A command must begin with a right parenthesis.  
+Consult Appendix C for a complete description of the command syntax.
+.pp
+Debugging in FP is difficult;
+all undefined results map to a single
+atom \- \fIbottom\fP (\*(lq?\*(rq).
+To pinpoint the cause of an error the user can use
+the special debugging output function, \fBout\fP, or the tracer.
+.sp
+.NS 1 "Additions and Ommissions"
+.sp
+.pp
+Many relational functions have been added: $<,~~>,~~=,~~ \(!=, ~~<=,~~>=$;
+their
+syntax is: <, >, =, ~=, <=, >=.
+Also added are the \fBiota\fP function (This is the \s-2APL\s+2
+iota function
+an n-element sequence
+of natural numbers) and the exclusive OR (\z\(ci\(pl) function.
+.pp
+Several new structural functions have been added:  \fBpair\fP
+pairs up successive elements of a sequence, \fBsplit\fP splits
+a sequence into two (roughly) equal halves, \fBlast\fP returns
+the last element of the sequence (<> if the sequence is empty),
+\fBfirst\fP returns the first element of the sequence
+(<> if it is empty), and \fBconcat\fP
+concatenates all subsequences of a sequence, squeezing out null sequences (<>).
+\fBFront\fP is equivalent to \fBtlr\fP.
+\fBPick\fP is a parameterized form of
+the selector function; the first component of the argument selects
+a single element from the second component.
+\fBOut\fP is the only side-effect function; it is equivalent
+to the \fBid\fP function but it also prints its argument out at the
+terminal.  This function is intended to be used only for debugging.
+.pp
+One new functional form has been added, tree insert.  This
+functional form breaks up the the argument into two roughly equal pieces
+applying itself
+recursively to the two halves.  The functional parameter is applied to the
+result.
+.pp
+The binary-to-unary functions ('\fBbu\fP') has been omitted.
+.pp
+Seven mathematical library functions have been added: sin, cos, asin
+($sin sup {-1}$), acos ($cos sup {-1}$), log, exp, and mod (the
+remainder function)
+.bp
+.sx
+.nf
+.nr ii 18
+.AP "Appendix B: FP Grammar"
+\fII. BNF Syntax\fP
+.sp
+.ip "fpInput $->$"
+(fnDef | application | fpCmd\*(sa)\(**  | '^D'
+.ip "fnDef $->$"
+\&'{' name funForm '}'
+.ip "application $->$"
+funForm ':' object
+.ip "name $->$"
+letter (letter | digit | '_')\(**
+.ip "nameList $->$"
+(name)\(**
+.ip "object $->$"
+atom | fpSequence | '?'
+.ip "fpSequence $->$"
+\&'<' (\(*e | object ((',' | ' ') object)\(**) '>'
+.ip "atom $->$"
+\&'T' | 'F' | '<>' | '"' (ascii-char)\(** '"' | (letter | digit)\(** | number
+.ip "funForm $->$"
+simpFn | composition | construction | conditional |
+.br
+constantFn | insertion | alpha | while | '(' funForm ')'
+.ip "simpFn $->$"
+fpDefined | fpBuiltin
+.ip "fpDefined $->$"
+name
+.ip "fpBuiltin $->$"
+selectFn | 'tl' | 'id' | 'atom' | 'not' | 'eq' | relFn | 'null' | 'reverse' |
+.br
+\&'distl' | 'distr' | 'length' | binaryFn | 'trans' | 'apndl' | 'apndr' |
+.br
+\&'tlr' | 'rotl' | 'rotr' | 'iota' | 'pair' | 'split' | 'concat' | 'last' | 'libFn'
+.ip "selectFn $->$"
+(\(*e | '+' | '-') unsignedInteger
+.ip "relFn $->$"
+\&'<=' | '<' | '=' | '~=' | '>' | '>='
+.ip "binaryFn $->$"
+\&'+' | '-' | '\(**' | '/' | 'or' | 'and' | 'xor'
+.ip "libFn $->$"
+\&'sin' | 'cos' | 'asin' | 'acos' | 'log' | 'exp' | 'mod'
+.ip "composition $->$"
+funForm '@' funForm
+.ip "construction $->$"
+\&'[' formList ']'
+.ip "formList $->$"
+\(*e | funForm (',' funForm)\(**
+.ip "conditional $->$"
+\&'(' funForm '->' funForm ';' funForm ')'
+.ip "constantFn $->$"
+\&'%' object
+.ip "insertion $->$"
+\&'!' funForm | '\fB|\fP' funForm
+.ip "alpha $->$"
+\&'&' funForm
+.ip "while $->$"
+\&'(' 'while' funForm funForm  ')'
+.sp
+.lp
+.nf
+\fIII. Precedences\fP
+.sp
+1.     %, !, &                 (highest)
+2.     @
+3.     [$...$]
+4.     -> $...$ ; $...$
+5.     while                   (least)
+.(q
+.sp 2
+\*(sa Command Syntax is listed in Appendix C.
+.)q
+.fi
+.AP "Appendix C: Command Syntax"
+.pp
+All commands begin with a right parenthesis (\*(lq)\*(rq).
+.sp 2
+.nf
+)fns
+)pfn <nameList>
+)load <UNIX file name>
+)cload <UNIX file name>
+)save <UNIX file name>
+)csave <UNIX file name>
+)fsave <UNIX file name>
+)delete <nameList>
+)stats on
+)stats off
+)stats reset
+)stats print [UNIX file name]
+)trace on  <nameList>
+)trace off <nameList>
+)timer on
+)timer off
+)debug on
+)debug off
+)script open <UNIX file name>
+)script close
+)script append <UNIX file name>
+)help
+)lisp
+.EQ
+delim `'
+.EN
+.AP "Appendix D: Token-Name Correspondences"
+.TS
+center box;
+c|c
+c|l.
+Token  Name
+=
+\&[    lbrack$$
+\&]    rbrack$$
+\&{    lbrace$$
+\&}    rbrace$$
+\&(    lparen$$
+\&)    rparen$$
+\&@    compos$$
+\&!    insert$$
+\&\fB|\fP      ti$$
+\&&    alpha$$
+\&;    semi$$
+\&:    colon$$
+\&,    comma$$
+\&+    builtin$$
+\&+ `mu sup a' select$$
+\&\(** builtin$$
+\&/    builtin$$
+\&=    builtin$$
+\&-    builtin$$
+\&->   arrow$$
+\&- `mu'       select$$
+\&>    builtin$$
+\&>=   builtin$$
+\&<    builtin$$
+\&<=   builtin$$
+\&~=   builtin$$
+\&%`omicron sup b'     constant$$
+.TE
+.sp 2
+.(q
+\*(sa \(*m is an optionally signed integer constant.
+.sp
+\*(sb \(*o is any FP object.
+.)q
+.AP "Appendix E: Symbolic Primitive Function Names"
+.pp
+The scanner assigns names to the alphabetic primitive functions by
+appending the string \*(lq$fp\*(rq to the end of the function name.
+The following table designates the
+naming assignments to the non-alphabetic primitive function names.
+.sp
+.TS
+center box;
+c|c
+c|l.
+Function       Name
+=
+\&+    plus$fp
+\&-    minus$fp
+\&\(** times$fp
+\&/    div$fp
+\&=    eq$fp
+\&>    gt$fp
+\&>=   ge$fp
+\&<    lt$fp
+\&<=   le$fp
+\&~=   ne$fp
+.TE
+.TC