home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / language / lambdoc / lambda.man < prev    next >
Encoding:
Text File  |  1989-03-15  |  35.9 KB  |  746 lines

  1. ------------------------------------------------------------------------
  2. [LAMBDA.MAN].ATARI.ST [1.37][890304], revised from MAC.LS [1.28][890116]
  3. ------------------------------------------------------------------------
  4.  
  5.   LAMBDA : A LAMBDA-CALCULUS INTERPRETER AND COMBINATORY CODE GENERATOR
  6.  
  7.                             Adrian Rezus (1989)
  8.              
  9.    0. LAMBDA is a lazy micro-interpreter for [type-free] LAMBDA-calculus 
  10.    [BETA-] reductions and standard combinator expansions [i.e., the Curry 
  11.    "abstraction algorithms"]. The evaluator does "standard" [left-to-right, 
  12.    left-most-outermost] reductions, using an idea of W. L. van der Poel 
  13.    [formerly at the Technological University of Delft, The Netherlands]. 
  14.    It runs in different variants, on almost any machine for which a 
  15.    reasonable C-compiler is available. BCPL and [Franz, Mu, etc.] LISP 
  16.    variants are also operational. LAMBDA includes also an ASCII-editor, 
  17.    based on Ken Thompson's `ed' [the "standard" UN*X editor], intended 
  18.    for use in LAMBDA-input preparation. If a UN*X-like shell is present, 
  19.    LAMBDA acts as an extension of the current shell. 
  20.  
  21.    0.0 COPYRIGHT SPECIFICATIONS:
  22.  
  23.        This program has no specific restrictions as regards duplication
  24.        and/or modification, as far as the this re-distribution does not 
  25.        have commercial purposes. Also, no "share-" [and/or any other 
  26.        kind of] "...-ware" use-restrictions are applicable.      
  27.  
  28.        On the other hand, no "user-" and/or "upgrade-support" can be
  29.        provided, otherwise than by private mail and/or - if necessary 
  30.        - via the appropriate [...NET].NEWS-channels.
  31.  
  32.        Portions of the code incorporated in the current version of 
  33.        LAMBDA are based on copyrighted material and/or some - otherwise
  34.        excellent - public domain software packages [C-libraries, etc.]. 
  35.        The exact references to this kind of material are specified in 
  36.        the source-code, for each particular machine/environment. The 
  37.        source-code cannot be re-distributed and/or circulated "as is" 
  38.        without these acknowledgements. 
  39.  
  40.        The binaries - originally provided - should also contain, as an 
  41.        internal "stamp", such acknowledements, either user-transparent 
  42.        [via a built-in command `version'] or user-hidden by a static 
  43.        declaration and/or by other means. The actual contents of such 
  44.        a "stamp" should mainly depend on the compiler options used to 
  45.        generate the current version of LAMBDA. The binaries cannot be
  46.        re-distributed and/or circulated without this internal "stamp".
  47.  
  48.    0.1 BASIC REFERENCES [type-free lambda-calculus and combinators]:
  49.    
  50.      J. R. HINDLEY, J. P. SELDIN "Introduction to Combinators and 
  51.         Lambda-calculus", Cambridge UP: London etc. 1986 [London
  52.         Mathematical Society Student Texts 1]. [Up-to-date upgrade
  53.         of the first - 1972 - elementary introduction to lambda-
  54.         calculus. Main audience: students in mathematics and computer 
  55.         science. Highly readable, even by non-experts. The authors 
  56.         are - both - former students of H. B. Curry, the father - 
  57.         one of them, anyway - of combinatory "logic".]
  58.      R. M. SMULLYAN "To Mock a Mocking-Bird", Knopf: New York, 1985.
  59.         [An ingenious ornithological metaphor around combinator-
  60.         behaviors. Offers a pleasant - non-mathematical - access to 
  61.         the world of lambda/combinators. Read this first if you have
  62.         never heard about combinators or lambda-calculus before!]
  63.      H. P. BARENDREGT "The Lambda Calculus, Its Syntax and Semantics",   
  64.         North Holland: Amsterdam etc. 1981. [The basic treatise. Main
  65.         audience: mathematics/computer science students and researchers
  66.         in theoretical computer science. Second revised edition: 1984.]
  67.      A. REZUS "A Bibliography of Lambda-calculi, Combinatory Logics 
  68.         and Related Topics", Mathematical Centre: Amsterdam 1982.
  69.         [Currently distributed by: CWI, Kruislaan 413, Amsterdam, NL.]
  70.      A. REZUS "On a singleton basis for the set of closed lambda-terms",
  71.         Libertas mathematica (Arlington TX) 2, 1982, page 94. [Documents
  72.         Carew Meredith's (shortest) generator; i. e.  MU, sub 1 below.]
  73.      A. REZUS "Lambda-conversion and Logic", Ph. D. Diss., Utrecht 1981.
  74.         [Monograph of a modern version of Church's original calculus of
  75.         lambda-conversion, as improved within his school - S. C. Kleene, 
  76.         J. B. Rosser and A. Turing - during the early thirthies; the 
  77.         advanced parts contain applications to logic and arithmetic.]
  78.      W. L. VAN DER POEL et al. "New arithmetical operators in the theory 
  79.         of combinators", Indagationes mathematicae 42, 1980, pp. 271-325.
  80.         [The main idea of the present implementation. Contains also the 
  81.         stripped-down source of a LISP-variant, due to G. van der Mey.]
  82.      C. BOEHM, W. GROSS "Introduction to the CUCH", in: E. R. CAIANIELLO
  83.         (editor) "Automata Theory", Academic Press: New York etc., 1966, 
  84.         pp. 35-65. [Apparenty, CUCH (short for "CURRY + CHURCH") is the 
  85.         first implementation of lambda-calculus, at least in Europe.]
  86.      H. B. CURRY et al. "Combinatory Logic" (2 vols.), North Holland: 
  87.         Amsterdam, 1958, 1972. [The old encyclopaedia. Reprinted since.]
  88.      A. CHURCH "The Calculi of Lambda-Conversion", Princeton University 
  89.         Press, Princeton 1941. [The first book on the subject, derived 
  90.         from a Princeton logic course (1935-1936) of the author. Second 
  91.         edition: 1951; also University Microfilms: Ann Arbor reprints.]
  92.  
  93.    0.3  OTHER REFERENCES:
  94.  
  95.      B. W. KERNIGHAN & R. PIKE "The UN*X Programming Environment",
  96.         Prentice Hall International Inc. London 1984 [Prentice Hall 
  97.         Software Series]. [Useful mainly for the discussion of the 
  98.         editor, the pattern matching utilities and the "standard" 
  99.         shell environment/support.]
  100.  
  101.    0.3  VERSION [ver$]:
  102.  
  103.         current:    'lambda 1.37a [ATARI.ST][UN*X BSD][MINIX].C'
  104.                     'lambda 1.30m [Apple MACintosh].[MFS].C'
  105.  
  106.         prototypes: 'mlambda.2.1.ATARI.ST.[Mark Williams].C', 
  107.                     'mlambda.2.0.BSD.C',
  108.                     'lambda.1.1.MAC.[Lightspeed].C'
  109.  
  110.    0.31 HISTORY OF CODE: 
  111.  
  112.         This version is a conversion from BCPL [Richards standard] 
  113.            version [lambda.4.0.REZUS.BCPL:KU.NIJMEGEN]. 
  114.  
  115.         Ancestors [LIFO-order]: 
  116.            version [lambda.4.30.REZUS.BSD.C:KU.NIJMEGEN], 
  117.            version [comb.1.0.NIJENHUIS.EXIDY.BDS.C:TU.DELFT], 
  118.            version [comb.[antique].VAN-DER-MEY.PDP11.LISP:TU.DELFT], 
  119.            version [comb.[Ur-version].VAN-DER-MEY.PDP11.ALIAS:TU.DELFT].
  120.  
  121.         Dutch cousins [best known to me]:
  122.            version [lambda.l.REZUS.BSD.[+ FRANZ:Opus.38.69].LISP:KU.NIJMEGEN],
  123.            version [Lambda-&-Combinators.NIJENHUIS.MSDOS.LATTICE.C:TU.DELFT],
  124.            version [lc.KOYMANS.VMS.ALGOL68:RU.UTRECHT] [advanced, lost!].
  125.  
  126.    0.32 COMPILERS [for tested variants of `lambda': current version]:
  127.  
  128.      - [UN*X BSD]:   the "portable C compiler" and/or derivatives
  129.  
  130.      - [MINIX]:      MINIX-ST C, ACK 
  131.  
  132.      - [ATARI.ST]:   MARK WILLIAMS C 3.06, 
  133.                      LATTICE C 3.04.01 
  134.                      TURBO C [for PROTO-typed variant of MW C version] 
  135.  
  136.      - [MAC]:        LIGHTSPEED C [> 2.02] 
  137.  
  138.    0.4 NOTICE ON [WARNING(S)]: Supposedly dangerous actions in `lambda' 
  139.        are marked with an "!" appearing below on the left hand side of 
  140.        a [WARNING] or of a technical note [NB]!   
  141.    !   Example: [WARNING]: See 2.0.A1!
  142.  
  143.    0.5 DOCUMENTATION: This document specifies briefly only the global
  144.        features of `lambda' and is not intended to describe in detail 
  145.        any particular implementation. The general pattern is UN*X-like, 
  146.        however. Idiosyncrasies, diverging from this usage on a SPECIFIC 
  147.        machine/operating-system, more information, specific problems, 
  148.        etc. are contained in the following documents: 
  149.        
  150.          (description: [audience]: <title-of-document> <comments>).
  151.  
  152.        - [programmers]: 
  153.          "LAMBDA Source-Code" [actual size is system-specific: 115-165 Kb].
  154.  
  155.        - [other]: 
  156.          "LAMBDA.[VERSION].[MACHINE].[LANGUAGE].[COMPILER] Technical Notes",
  157.          NB: Some "LAMBDA [...] Technical Notes" may NOT be available.
  158.                    
  159.        - [general]: 
  160.          "A LAMBDA-Tutorial" [in preparation].
  161.  
  162.        - [general, lambda-calculus hackers]: 
  163.          "A History of Lambda-calculus/Combinator Interpreters" [draft].
  164.   
  165.        - [general]: Sample input shell-scripts.
  166.  
  167.        - [general]: Sample term-libraries. 
  168.  
  169.    1. SYNTAX. The MAIN [INTERPRETER-] module of `lambda' recognizes the 
  170.       following TERM-SYNTAX:
  171.  
  172.        NB: Greek `LAMBDA' prints as `L' in the current C-version and below.
  173.  
  174.        NB: Below, `print-name' refers to the portable, ASCII-only variant.
  175.  
  176.        - BUILT-IN ATOMS: <name> [<print-name>] = <semantics>
  177.    !     NB: These are reserved symbols in default mode. The user may 
  178.    !         re-define the reserved symbols with the appropriate 
  179.    !         evaluation option ["mode"]. Caution!
  180.  
  181.          mode [lib-]:
  182.          NB: Minimal set: active in [lc]-, [cl]-, [cl conv]-modes.
  183.        
  184.           #   [#]    =  an arbitrary atom [not user definable!], 
  185.                         [used as an internal dummy or as a head-variable]
  186.           S   [S]    =  (Lx(Ly(Lz(xz(yz)))))
  187.           K   [K]    =  (Lx(Lyx)) 
  188.           I   [I]    =  (Lxx)
  189.           B   [B]    =  (Lx(Ly(Lz(x(yz))))) 
  190.           C   [C]    =  (Lx(Ly(Lz(xzy))))
  191.           W   [W]    =  (Lx(Ly(xyy)))
  192.           ()  [none] =  NIL 
  193.                         [vanishes, behaving as (I) - IF in head-position 
  194.                          evaluates to the dummy #  - ELSE]
  195.  
  196.          mode [lib+]:
  197.          NB: Activates the following atomic [lc]-behaviors 
  198.              (re-activating the minimal set above, if necessary).
  199.    !     NB: Mode [lib+] restores the behavior of all reserved symbols
  200.    !         (i. e., erases user definitions of built-ins, if any).
  201.    !     NB: SUCC, SUM, PROD, EXP have the expected behavior only on 
  202.    !         Church numerals: <0> = (KI), <n+1> = (SUCC <n>)
  203.  
  204.           #    [#] =  an arbitrary atom           [user definable dummy]
  205.           J    [J] =  (Lx(Ly(Lz(Lu(xu(xyz))))))   [Rosser's J]
  206.           PHI  [F] =  (Lx(Ly(Lz(Lu(x(yu(zu))))))) [Curry's PHI]
  207.           PSI  [U] =  (Lx(Ly(Lz(Lu(x(yz(yu))))))) [Curry's PSI]
  208.           PI   [P] =  (Lx(Ly(Lz(z(xy)))))         [Church's PAIRing]
  209.           ZERO [0] =  (Lx(Lyy))                   [Church's NULL-numeral]
  210.           SUCC [$] =  (Lx(Ly(Lz(y(xyz)))))        [Church's SUCCessor]
  211.           SUM  [+] =  (Lx(Ly(Lz(Lu(xz(yzu))))))   [Rosser SUM]
  212.           PROD [B] =  (Lx(Ly(Lz(x(yz)))))         [Rosser PRODuct]
  213.           EXP  [^] =  (Lx(Ly(yx)))                [Rosser EXPonentiation]
  214.           MU   [M] =  (Lx(Ly(Lz(y(Luz)(xz)))))    [Carew Meredith's generator]
  215.  
  216.        - LAMBDA-syntax [a, b are terms]:
  217.          ( <atom> ),              - <atom> is a single symbol
  218.          ( a b )
  219.          ( Lx (a) )
  220.  
  221.          Examples: (Lx(Lyy)), (Lx(Ly(Lz(y(Luz)(xz))))), ...
  222.   
  223.        - COMBINATOR-syntax [a, b are terms]:
  224.          ( <atom> )               - built-in on start: S K I B C W  
  225.          ( a b )
  226.  
  227.          Examples: (SI), (BC(KI)), (BK), (SKK), (WWW), ...
  228.  
  229.        - LISP-like syntax [a is a term, defined is a <(head-)list>]:
  230.           ()                      - NIL
  231.           ( a <list> )
  232.  
  233.           Examples ["==>" means "evaluates to the value of"]:
  234.             ( (BC) (BI) (CK) )         ==> (#(BC)(BI)(CK))
  235.             ( (BI) ( (BC) () ) )       ==> (#(BI)(#BC))
  236.  
  237.        NB: NO SPACEs in a <term>, except in head-position. 
  238.           Examples [see also the section on PRE-PROCESSING]:  
  239.             (Lx (Ly (x y) ) )          ==> (Lx(Ly(xy)))
  240.             (B( B   I S)C K)           ==> (B(BIS)CK)
  241.             ( (B I)( (B C  ) (  ) ) )  ==> (#(BI)(#BC))
  242.  
  243.        NB: User-input is PRE-PROCESSED with automatic error recovery.
  244.        NB: LAMBDA-, COMBINATOR- and LIST-syntax can be mixed, as in CUCH.
  245.  
  246.    2. THE [MAIN] COMMAND INTERPRETER. 
  247.    !   NB [WARNING]: Some commands may be different in other versions.
  248.    
  249.    2.0. EXECUTING 'MODES'.
  250.  
  251.    A. Shell support ['(N)PD'  means , of course, "(Not) public domain"].
  252.  
  253.       - Recommended shells:
  254.  
  255.         [UN*X BSD]:  - [bsh] = the Bourne shell [default: `/bin/sh'],
  256.                      - [csh] = the C shell [default: `csh'],
  257.         [MINIX]:     - [bsh] = the MINIX shell [default: `/bin/sh'],
  258.         [ATARI.ST]:  - [msh] = the Mark Williams shell [`msh'] (NPD),
  259.                      - [ash] = ASHELL.PRG [author: Jerry Nowlin] (PD)
  260.                      - [bsh] = the Beckemeyer Micro C-shell [> 2.62](NPD)
  261.    !                 - [gsh] = `gulam' [author: Prabhaker Mateti] (PD),
  262.                      - [ssh] = `Craft 2.02' [author: Gert Poletiek] (NPD),
  263.                      - [csh] = the Beckemeyer C-shell [`csh'] (NPD).
  264.    !    [MACintosh]: - [???] = [none available]
  265.  
  266.    A1. Interactive use:
  267.  
  268.    1:  - BOOTing `lambda' from a shell: lambda <options>.
  269.         NB: The LAMBDA-<options> are, in general, system-dependent.
  270.    !        Some systems may support the <options> on stand-alone BOOTing.
  271.    !        Check details with the current [Technical Notes], if present.
  272.  
  273.    2:  - A shell [is present in the current environment, but] inactive:
  274.  
  275.           mode [sh-]: leaves active at least the system [shell] commands: 
  276.                       [ls][mem][du][pwd][cd][mkdir][rmdir][date][!]
  277.  
  278.    3:  - A shell is active and [the <internal/external shell-type> is] 
  279.          recognized by `lambda':
  280.  
  281.           mode [sh+]: unrecognized external syntax is passed as such to 
  282.                       the underlying shell, if this one is present in the
  283.                       current environment, otherwise echo: 'No shell'.
  284.  
  285.    4:  - If the shell [-type] is not recognized: no echo (or side-effects!).
  286.  
  287.    !  - Change shell with [system-specific]: sys <shell-type>.
  288.    !    [WARNING]: using two different `system()'-calls with the same
  289.    !               shell can have unexpected side-effects.
  290.  
  291.    A2. Non-interactive [`batch'] processing: uses the underlying shell's 
  292.        conventions for io-redirection (usually, UN*X-like).
  293.   
  294.        Examples:
  295.  
  296.          lambda < command-file                : reads commands from 
  297.                                                 <command-file> and
  298.                                                 writes to screen
  299.          lambda < command-file > output-file  : ditto for reading, 
  300.                                                 writes to <output-file>
  301.          lambda < command-file | some-other   : ditto for reading,
  302.                                                 sends output to 
  303.                                                 <some-other> reader.
  304.  
  305.        NB: On most systems, the <output-file> can be also a printer 
  306.            and/or some other periferial [device].
  307.  
  308.    !   [WARNINGS]: 
  309.    !     - LAMBDA is an INTERPRETER: a <command-file> must end with `exit'.
  310.    !     - In non-interactive processing, it is recommended to disable 
  311.    !       first the interactive mode of `lambda' [see command `talk-'].
  312.  
  313.    B. Stand-alone:
  314.  
  315.       - BOOTing `lambda': this is a system-specific operation 
  316.         (e. g., on [MACintosh]: [CLICK-ON] `lambda'-icon).
  317.  
  318.       - NB: Shell-specific commands are ignored (echo: `No shell' on [sh+]).
  319.  
  320.    !  - NB: However, even on stand-alone BOOTing, the `lambda'-mode [sh+], 
  321.    !        with the default shell <external-type> actually present in the  
  322.    !        current environment has effect similar to sub-case A1:3 above.
  323.  
  324.    2.1. OPERATING `MODES'.
  325.  
  326.    A. Help:
  327.  
  328.       help                     Display a synoptic HELP-PAGE.
  329.  
  330.       local                    Display an overview of the LOCAL COMMANDS
  331.                                currently available [system-dependent].
  332.  
  333.       ?                        Show current operating mode
  334.  
  335.    B. Set main operating options:
  336.  
  337.       lc                       LAMBDA-CALCULUS [BETA-] REDUCTIONS
  338.                                [default on start-up]
  339.  
  340.       cl                       COMBINATOR REDUCTIONS/EXPANSIONS
  341.                                [the expansions are done via `conv']
  342.  
  343.       conv                     CURRY ABSTRACTION ALGORITHMS
  344.                                [= switch to code-generator]
  345.                                [also a sub-option of the `cl'-mode]
  346.  
  347.    C. Set code-generation options [in `conv'-mode]:
  348.  
  349.       [conv] bc[+][-]          [de]activate the BC-code generation
  350.                                [default: generate SK(I)-code only]
  351.  
  352.       [conv] ext[+][-]         [de]activate extensionality
  353.                                [default: ext-][= generate "fat" code]
  354.  
  355.    D. Execute (= `eval'):
  356.       [NB: The <term> list must be LISP-like! 
  357.            If head-evaluation is required, use LIST-syntax!].    
  358.  
  359.       {do} (<term> ... <term>) reduce/expand <term>s
  360.  
  361.       See Examples under G. below.
  362.  
  363.    E. Trace to display-stream [NB: default to screen]:
  364.  
  365.       trace[+][-]              [de]activate the tracing [of executions]                                        
  366.                                [default: trace+]
  367.  
  368.       [trace+] pp[+][-]        [de]activate the pretty-printer for traces
  369.                                [default: pp-]
  370.  
  371.    F. Editing an ASCII-file with the built-in EDITor:
  372.       NB: The editor currently built-in is a stripped-down version 
  373.           of Ken Thompson's `ed', the "standard" UN*X line-editor.
  374.           [ALTERNATIVE: uses `microEmacs' instead.]
  375.  
  376.       edit { <file> }          edit [ASCII] <file> with built-in EDITor
  377.  
  378.       NB: Without the <file> argument, the editor supplies a default 
  379.           template (e. g., on a Macintosh, a temporary file `EditStuff').
  380.           In such cases, DO `W[w](rite) <file>' to save the <file>.
  381.  
  382.    !  [WARNING]: On most systems, the built-in editor (`edit') requires
  383.    !             a directory `tmp' in the operating environment. 
  384.    !  NB: This convention does NOT apply to MACintosh [MFS] version(s)! 
  385.  
  386.       FEATURES:
  387.  
  388.           - Basic regular expression recognition ["standard"].
  389.  
  390.           - "Standard" commands: a(ppend),  c(hange),      d(elete), 
  391.                                  E[e]dit,   f(ile),        g(lobal),
  392.                                  i(nsert),  j(oin),        k(ey = mark),
  393.                                  m(ove),    l(ist octal),  p(rint ASCII),
  394.                                  Q[q](uit), r(ead),        s(ubstitute),
  395.                                  u(ndo),    v(= global),   W[w](rite),
  396.                                  (<line>)=  (= print <line> number).
  397.  
  398.           - Additional commands [NON-"standard"]:
  399.             NB: The MACintosh-mode [MFS] supports [V <file>][H] only!
  400.  
  401.             !                    = escape to the current shell, if any
  402.             V <file>             = VIEW <file> interactively = VISIT <file> 
  403.             D                    = DISK usage of current working directory
  404.             M                    = MEMORY currently available
  405.             T                    = system date and TIME,
  406.             L                    = LIST files on current working directory
  407.             H                    = edit-HELP summary
  408.  
  409.           - VIEW/VISIT [sub-] mode: 
  410.             NB: Following a `V <visited-file>' command, as for `cat', below.
  411.             NB: These features are also NOT "standard"!
  412.                                     
  413.             b[B]                 = BACK = go to top of <visited-file>
  414.             e[E] <file>          = EDIT <file> with built-in editor
  415.             q[Q]                 = QUIT the current viewing [no changes]
  416.             <other>              = go to the <visited-file>'s next page
  417.  
  418.       NB:  For a detailed documentation of the "standard" features of `ed', 
  419.             - see KERNIGHAN & PIKE [84] 'Appendix I: Editor Summary',
  420.             - see also `The UN*X Programmer's Manual' ED(1),
  421.             - or do [on most UN*X-like systems]: `man ed'.
  422.  
  423.    G. PRE-PROCESSING the term-syntax [of the user-input]:
  424.  
  425.    ------------------------------------------------------------------------   
  426.    |  If the term-syntax of the input is defective, the interpreter will  |
  427.    |  report some diagnostics and attempt to recover parts of it in a     |
  428.    |  usable form. The syntax error recovery feature CANNOT be switched   |
  429.    |  off (!) but the verbosity of the diagnosis can. See [talk-] below.  |
  430.    ------------------------------------------------------------------------
  431.  
  432.       talk+                    activate diagnostics on syntax error,
  433.                                proceed interactively:
  434.                                  IF <term-syntax-error>
  435.                                    - guess user's intentions, 
  436.                                    - propose a syntactically correct 
  437.                                                recovery input,
  438.                                    - ask user if he wants to evaluate
  439.                                                recovered term(s),
  440.                                    - on `y[Y]': evaluate,
  441.                                    - on `n[N]': abort
  442.  
  443.       talk-                    deactivate diagnostics on syntax error,
  444.                                non-interactive processing:
  445.                                  IF <term-syntax-error>
  446.                                    - guess user's intentions, 
  447.                                    - propose a syntactically correct 
  448.                                      recovery input,
  449.                                    - evaluate recovered term(s).
  450.  
  451.    !  [WARNING]: Set ALWAYS [talk-] as a first command in <shell-script>s 
  452.    !             processed non-interactively (e. g., while executing 
  453.    !             processes like: `lambda < shell-script')!
  454.       NB: This is NOT necessary in [read]-mode! E. g., on [talk+], a 
  455.           command like `read <command-file-with-syntax-errors>' will 
  456.           still cause the interpreter to ask your permission before 
  457.           attempting to evaluate!
  458.  
  459.       NB: Intersticed SPACEs in non-critical positions are always ignored.
  460.  
  461.       Examples of input recovery (value depends on current execution mode:
  462.       [lc] [cl] [conv] {[ext[+][-], bc[+][-]}) lib[+][-]).
  463.  
  464.       NB: analogous scripts work for [def][defnf][defrec] <name> = <term>.
  465.  
  466.            INPUT:            ACTION:
  467.            ------            -------
  468.            (BBB)           = evaluate (BBB)
  469.            do (BBB)        = same as before
  470.            (L(xx)x)        > evaluates to itself, (why?)
  471.            NIL             > yields <don't-know-about-this> ?
  472.            do (   )        > evaluates to () [= NIL]        ()
  473.            ( (BIC) (CI) )  = evaluate (#(BIC)(CI)           (!)
  474.            do ( BIS (CI) ) = evaluate (BIS(CI))             (!!)
  475.            do (WWW)        > runs forever, without          (!!!)
  476.                            > consumming space and/or memory (!!!)
  477.            ( (WWW)(<this>) = ditto for (#(WWW)(<this>)),    (!!!!)
  478.                            > we shall never reach <this>    (!!!!)
  479.            ( B(BB(         = recovered as (B(BB#))          (!!!!!)
  480.            do (BI))))      = recovered as (BI)              (!!!!!!)
  481.                            > post-poned junk ignored        (!!!!!!)
  482.            (BC)SSGARBAGE   = recovered as (BC)              (!!!!!!!)
  483.            (S IS I)is(bad) = recovered as (SISI)            (!!!!!!!!)
  484.                            > without post-poned rumors      (!!!!!!!!)
  485.            ( S B           = recovered as (SB)              (!!!!!!!!!)
  486.                            > evaluates to value of SUCC     (!!!!!!!!!)
  487.                                  (( A N D ) ( S O ) ( O N... !!!!!!!!!)
  488.  
  489.    -----------------------------------------------------------------------
  490.    | [MORALS] You may wisely use SPACEs in order to make terms readable! |
  491.    |          Lazy people may always forget about closing parentheses!   | 
  492.    |          Distracted people may always forget about LAMBDA-syntax!   |
  493.    -----------------------------------------------------------------------
  494.  
  495.    2.2. IO MANAGEMENT. 
  496.  
  497.    A. Output back-up [history shell facility] and re-direction:
  498.        NB: Certainly, the standard output is NOT de-activated on back-up.
  499.        NB: The HELP- and the LOCAL-HELP pages are NEVER back-ed up!
  500.     !  NB: The command `cat <file-to-visit>' with a <history-file> 
  501.     !      switched on will also insert a copy of the <file-to-visit> 
  502.     !      in the current <history-file>! However, `edit <file-to-edit>' 
  503.     !      (the EDITor operations) are NOT backed up! Also, for obvious 
  504.     !      reasons [whenever applicable], system- and shell-specific 
  505.     !      actions from within `lambda' are NOT saved to a would-be
  506.     !      <history-file>: this task is likely to be passed on to the 
  507.     !      supporting shell, if any...
  508.  
  509.       open <history-file>      open a new <history-file>, 
  510.                                back-up the current session to it 
  511.  
  512.       print+ <history-file>    activate back-up to the <history-file>
  513.  
  514.       print-                   deactivate back-up to current <history-file>.
  515.  
  516.    !  [WARNING]: If you forget the history shell tracing switched on, you 
  517.    !             may sooner or later end up with no room left on the disk
  518.    !             of the current working directory! 
  519.  
  520.    B. Standard IO operations [built-in commands]:
  521.        NB: These commands do NOT need a shell.
  522.        NB: On most systems, the <file> must be ASCII only.
  523.  
  524.       read <command-file>      read <command-file>, execute the contents 
  525.  
  526.       NB: If some shell is present, the <command-file> can be also used 
  527.           as a shell script, within [sh+]-mode.
  528.  
  529.       cat <file>               view <file>, visit <file>,                                    
  530.                                - b[B]    = BACK = go to top of <file>
  531.                                - e[E]    = EDIT the <file> 
  532.                                - q[Q]    = QUIT viewing the <file>
  533.                                - <other> = go to the next page of <file>
  534.  
  535.       rm <file>                delete [= unlink] <file>,
  536.  
  537.    !  [WARNING]: Caution [it works nearly always]: no recovery after `rm'!
  538.    !             E. g., try [on your risk] `rm Finder' on a MAC!
  539.  
  540.       sound[+][-]              [de]activate bell-warnings
  541.  
  542.    2.3. TERM LIBRARIES: 
  543.  
  544.    A. Default library of built-in terms:
  545.  
  546.       lib[+][-]                [de]activate library of built-in terms
  547.  
  548.       default-`lib' contents [standard documentation, see BUILT-IN ATOMS]:
  549.   
  550.         Resident term-library:  S, K, I, B, C, W (BARENDREGT [84])
  551.                                 [NB: `lib-' does NOT delete them!]
  552.  
  553.         Non resident built-in [lambda-] terms (in [lib+]-mode):
  554.  
  555.         J    : Rosser's J combinator (CHURCH [41])
  556.         PI   : Church's PAIRing combinator (CHURCH [41])
  557.         MU   : [Carew] Meredith's [last] generator (REZUS [82])
  558.         PHI  : Curry's "formal substitution" PHI (BARENDREGT [84])
  559.         PSI  : Curry's PSI combinator (BARENDREGT 84])
  560.         SUCC : Church's SUCCESSOR [= SB] (CHURCH [41])
  561.         SUM  : SUM on Church numerals (CHURCH [41])
  562.         PROD : PRODUCT on Church numerals [= B] (CHURCH [41])
  563.         EXP  : EXPONENTIATION on Church numerals [= CI] (CHURCH [41])
  564.         0    : Church's numeral 0 [= KI = CK] (CHURCH [41])
  565.  
  566.    B. Current user definitions [internal term-library maintenace]:
  567.  
  568.        NB  [C, BCPL versions]: <name> is a single [upper-case] character.
  569.  
  570.        NB: Defining modulo normal forms, by `defnf', may fail [that is: 
  571.            `lambda' would run forever] if the <term> is not normalizable 
  572.            in standard reduction order (try `def' instead, on doubt). 
  573.            
  574.    !       Still, see the LOCAL COMMANDS on your specific system for 
  575.    !       details on ABORTing non-terminating `lambda'-processes. 
  576.  
  577.        NB: Here, "current definition" means "current USER definition".
  578.  
  579.    B1. Defining modes:
  580.  
  581.       def <name> = <term>      define <name> as <term>
  582.                             
  583.       defnf <name> = <term>    define <name> as the normal form of <term>
  584.  
  585.       <name>  <  <term>        internal alias for `defnf <name> = <term>'        
  586.  
  587.       defrec <name> = <term>   recursive `def <name> = <term>'      
  588.                                [E. g.: `defrec H = (SH(BH))', etc.]
  589.  
  590.    B2. User library maintenance [internal]:
  591.  
  592.       list                     list the current term-definitions
  593.  
  594.       show   <name>            show the current definition of <name> 
  595.  
  596.       copy   <name1> <name2>   define <name2> as definiendum of <name1>,
  597.                                keep the current definition of <name1>  
  598.  
  599.       rename <name1> <name2>   re-define <name2> as <name1> and
  600.                                forget the current definition of <name1>
  601.  
  602.       delete <name>            forget the current definition of <name>
  603.  
  604.       new                      forget all current definitions
  605.  
  606.    C. User library maintenace [external]:
  607.    !   NB: The commands `put' and `get' may refuse to cope with user 
  608.    !       <file>s that are not generated by the same version of `lambda'.
  609.  
  610.    !   NB: Internally, the [MAIN] interpreter tags a user library with 
  611.    !       an initial reserved character (usually: @). User libraries  
  612.    !       are stored in machine-readable format: do not edit them!.
  613.  
  614.        NB: Since the external term-libraries could be easily altered, 
  615.            by inadvertent manipulations, it is advisable to generate 
  616.            the basic [and/or frequently used] term-libraries in non-
  617.            interactive mode or via a `read'-command, keeping always 
  618.            backups for the generating [shell-] scripts. This precaution
  619.            should also make term-libraries portable accross various 
  620.            versions/"upgrades" of `lambda' and would spare a lot of 
  621.            typing. As expected, such scripts can be also made/recovered 
  622.            by editing the appropriate segment of a <history-file> that 
  623.            has been saved previously.
  624.  
  625.       put <file>               save current user term-library to <file>
  626.  
  627.       get <file>               read user term-library from <file>.
  628.       
  629.    2.4. SYSTEM SUPPORTED COMMANDS: 
  630.        NB: System-specific; check with the appropriate [Technical Notes].
  631.        NB: On some systems, most of these commands may need a shell.
  632.       
  633.       !                        escape to the current shell
  634.       sh[+][-]                 [de]activate the current shell
  635.       sys                      change the current shell
  636.       pwd                      show name of current working directory
  637.       ls                       verbose list [ls -l] of cwd
  638.       du                       show disk usage for cwd-unit [= UN*X `du .']
  639.       cd <path>                change current directory to <path>
  640.       mkdir <path>             make directory <path>
  641.       rmdir <path>             remove directory <path>
  642.       mem                      show memory available [= UN*X `quota'] 
  643.       date                     show system date and time
  644.       ed [ex][vi] {<file>}     call a system editor [`ed'; BSD: `ex', `vi']
  645.       exit                     quit the [MAIN] interpreter.
  646.  
  647.       <any-other-string>       in [sh+]-mode: as interpreted by the 
  648.                                current shell, if any
  649.  
  650.       NB: The `lambda'-commands have precedence over any would-be 
  651.           identically labelled shell commands. In case of conflict, 
  652.           one can still use the !-escape, or do an aliasing in the 
  653.           current shell. Examples (1): 'ls' would always be verbose 
  654.           on any UN*X-like system; (2): on ATARI.ST, with `gulam' as
  655.           a current shell, do first 'alias  _help help' in order 
  656.           to get help from `gulam' by asking `_help'. 
  657.                                
  658.    3. BUGS.
  659.  
  660.    3.1. [Internal bugs]: Most obvious bugs occurring in previous versions 
  661.         of the [MAIN] interpreter have been removed. See also 4.0.
  662.  
  663.         NB: fixed from 1.28 on
  664.  
  665.         3.1.0: `read <command-file>' with non-existent <command-file>
  666.                restores the default input stream with <file-not-found> 
  667.                error: it doesn't crash the system [MAC][ATARI] any more.
  668.  
  669.         3.1.1: [MAC][ATARI][...]: single-key commands during evaluation
  670.                [see: <system-specific> Technical Notes] allow to abort 
  671.                stationary non-terminating LAMBDA-processes [e. g., 
  672.                (WWW), etc.]
  673.  
  674.    3.2. [External bugs: malfunctions of the MAIN interpreter, arising
  675.         from the co-operation with external/buggy/"hacking" programs]: 
  676.  
  677.         In general, the [MAIN] interpreter [i. e., the system-independent 
  678.         segment of `lambda'] does not co-operate optimally with external
  679.         programs that are "hacking into" the current system environment.
  680.  
  681.         Typically, external programs promoting a defective memory-
  682.         management or interferring too aggressively with the current
  683.         default setting of the periferials [console, keyboard, etc.] 
  684.         would also crash those `lambda'-triggered processes that make 
  685.         essential use of such system ingredients. Cases in point are 
  686.         the [MAIN's] term-library management, the built-in EDITor 
  687.         and the [VISIT/VIEW <file>]-functions. For instance, loading 
  688.         alternate fonts [via overlays], without informing the system 
  689.         about this, might cause bus/address [system] errors that won't 
  690.         be currently catched by [`lambda'-] MAIN.
  691.  
  692.         On the other hand, the [MAIN] "lambda-reduction machine", as 
  693.         well as the "combinatory code generator", have their private 
  694.         security and error recovery routines and are unlikely to be 
  695.         affected directly by "hacking programs". 
  696.          
  697.    3.3. [NOTE]. Further bug reports will be greatly appreciated. If you 
  698.         take the trouble to notice a bug and are willing to mention it 
  699.         to me, please, describe also in detail the environment used to 
  700.         execute `lambda'-processes. Before doing this, notice that 
  701.         `lambda' has not been originally intended for some particular 
  702.         machine, although it is guaranteed to act as specified at 
  703.         least with standard ASCII terminals and - whenever applicable 
  704.         - in conjunction with a reasonable Bourne-like shell. Most 
  705.         malfunctions that may count as "bugs" may be simply caused by 
  706.         some strange habits of the keyboard on your local machine, 
  707.         for instance or, by the use of a defective [external] shell-
  708.         interpreter. 
  709.  
  710.    4. TO DO: 
  711.  
  712.    4.0. Comment: 
  713.         ETA-reduction in [lc]-mode [current ver$] does NOT eliminate the
  714.         ETA-redexes generated by a BETA-reduction. This is NOT a bug: 
  715.         the interpreter proceeds in lazy-order. In order to remove all 
  716.         ETA-redexes (!) one has to re-input evaluation results [currently 
  717.         NOT supported (automatically)].
  718.  
  719.    4.1. YACC-parser for the command interpreter. Apparently NOT very
  720.         useful for the current variant(s). Certainly needed for the next 
  721.         four [4.2 - 4.5] items.
  722.  
  723.    4.2. Support for multi-character [word-length] term-definitions.
  724.         [NB: This is available only in LISP versions of `lambda'.]
  725.  
  726.    4.3. Extension to typed lambda-calculus and typed combinators.
  727.  
  728.    4.4. Extension to the `Boolean' [typed] case.
  729.  
  730.    4.5. Addition of "non-standard" reduction strategies. 
  731.  
  732.    4.6. Windows & graphics shell management (e. g., a la GEM). 
  733.  
  734.    4.7. Transport to other systems.
  735.  
  736.    5. DATE OF LAST REVISION: 890304. Previous: [890226-0111-6][881111].
  737.  
  738.    6. STANDARD DISCLAIMER:
  739.       "I make no warranty with respect to the contents of this document,
  740.       or the software it describes, and disclaim any explicit and/or
  741.       implied suggestions of usefulness for any particular purpose. 
  742.       Use of the described software presupposes the fact that the user 
  743.       is willing to assume all risks, and/or damages, if any, arising 
  744.       as a result, even if it is caused by negligence, ignorance or 
  745.       some other fault."       
  746.