Page Numbers: Yes X: 530 Y: 10.5" First Page: 33 Not-on-first-page Columns: 1 Edge Margin: .6" Between Columns: .4" Margins: Top: 1.3" Bottom: 1" Binding: -5 Line Numbers: No Modulus: 5 Page-relative Odd Heading: Not-on-first-pagel3175e12qk40(635)\g Towards an Interchange Standard for Editable Documentsz18697y756x2qc\g Even Heading: Not-on-first-pagel3175qk40\g Appendices: Glossary , Arbitrary Choices, Formal Semanticsz18697y756x2qc\g Towards an Interchange Standard for Editable Documentsz18697y648x2c\bg54f8 by Jim Mitchell and Jim Horningz18697y576x2e12\bg August 31, 1982 4:19 PMz18697x2e12\bg File: Interscript-app.bravoz18697x2e12\bg APPENDIX A GLOSSARYz18697y684x2e24ck648\bg1f7 7f6 5f7 7f6 Italics indicate words defined in this glossary.z18697l3008x3e12j(0,6816)\ig7I abbreviation An invocation used to shorten a script, rather than to indicate structurez18697l7239d2999e15jk20(0,7239)(1,7366)\bg12B1f7 3i10I19i6I35f6b attribute A component of an environment, identified by its name, which is bound to a value z18697l7239d2999e3jk20\bg9B1f7 18i11I20i4I22i5I1f6b base language The part of the Interscript language that is independent of the semantics of particular properties and attributesz18697l7239d2999e3jk20\bg13B1f7 16i11I61i10I5i10f6bI base semantics The semantic rules that govern how scripts in the base language are elaborated to determine their contents, environments, and labels z18697l7239d2999e3jk20\bg14B1f7 35i7I8i13I35i24I3i7I1f6b binding The operation of associating a value with a name to add an attribute to an environment; also the resulting association z18697l7239d2999e3jk20\bg7B1f7 31i5I8i4I11i9I7i11I33f6b binding mode A value may be bound to an identifier as local, const or global z18697l7239d2999e3jk20\bg12B1f7 2i5I20i10I4i13I3i6I1f6b Boolean An enumerated primitive type (F, T) used to control selection and as primitive values z18697l7239d2999e3jk20\bg7B1f7 13i15I24i9I8i16I1f6b const binding A binding of an attribute that prevents its being rebound in any contained scope z18697l7239d2999e3jk20\bg13B1f7 2i7I7i9I49i6I1f6b contents The vector of values denoted by a node of a script z18697l7239d2999e3k20\bg8B1f7 4i6I4i6I14i5I5i6I1f6b definition Another name for a const binding z18697l7239d2999e3k20\bg10B1f7 19i13I1f6b document The internalization of a script in a representation suitable for some editorz18697l7239d2999e3k20\bg8B1f7 4i15I6i6I45f6b dominant structure The tree structure of a document corresponding to the node structure of its script z18697l7239d2999e3jk20\bg19f7B24i8I22i4I18i6I1f6b editor-specific name A non-standard name used by a specific editor in scripts it generates; an editor may use editor-specific terms without interfering with the interchangeability of a script if it provides definitions of the standard names in terms of its editor-specific names z18697l7239d2999e3jk20\bg21f7B15i4I30i7I102i1I27i11I61f6b elaborate (verb) To develop the semantics of a script or a node of a script according to the Interscript semantic rules. This is a left-to-right, depth-first processing of the script z18697l7239d2999e3jk20\bg9B1f7 37i6I6i4I30i11I15f6 2f7 62f6b encoding A particular representation of scripts z18697l7239d2999e3k20\bg8B1f7 31i7I1f6b environment A value consisting of a set of attributes. An environment may be either free-standing or nodal. A free-standing environment is a structured value much like a record, with the components being the attributes of the environment. A nodal environment is associated with a node of a script and represents the attributes bound in that node. z18697l7239d2999e3k20\bg11B1f7 2i5I24i10I32i13I4i5I103i10I63i4I6i6I20i10I21f6b expression A syntactic form denoting a value z18697l7239d2999e3k20\bg10B1f7 28i5I1f6b external environment A standard environment relative to which an entire script is elaborated z18697l7239d2999e3k20\bg21f7B11i11I29i6I4i10I1f6b externalization The process of converting from a document to a script; also the result of that processz18697l7239d2999e3k20\bg15B1f7 33i8I6i6I33f6b fidelity The extent to which an externalization or internalization preserves contents, form, and structurez18697l7239d2999e3k20\bg8B1f7 3f6 2f7 6f6 2f7 2f6 2f7 5f6 2f7 2f6 1f7i15f6I1f7 2f6 1f7i15f6I1f7 9f6 1f7i8I1f6 1f7 5f6 1f7 3f6 1f7 9f6b hexInt A component of a hexSequence formed from a pair of letters in the set {A,B,...,O,P}, and representing an integer in the range [0..256) z18697l7239d2999e3jk20\bg6B1f7 17i11I47f6 3f7 27i7I23f6b hexSequence A sequence of hexInt pairs enclosed between "#" pairs and used to encode characters in string literals, e.g., #ENCODE#z18697l7239d2999e3jk20\bg11f7BG15i6I67i6I25f6bg hierarchical name A name containing at least one period, whose prefix unambiguously denotes the naming authority that assigned its meaningz18697l7239d2999e3jk20\bg17B1f7 2i4I114f6b identifier A sequence of letters used to identify an attribute z18697l7239d2999e3k20\bg10B1f7 42i9I1f6b integer A mathematical integer in a limited range; one of the primitive types z18697l7239d2999e3k20\bg7B1f7 54i15I1f6b interchange encoding The standard encoding for scripts z18697l7239d2999e3k20\bg20B1f7 13i8I5i7I1f6b internalization The process of converting from a script to a document; also the result of that processz18697l7239d2999e3k20\bg15B1f7 33i6I6i8I33f6b Interscript The current name of this basis for an editable document standard z18697l7239d2999e3k20\bg11B1f7 64f1 1f6b invocation The appearance of a name in an expression, except as the attribute of a binding z18697l7239d2999e3k20\bg10B1f7 20i4I7i10I16i9I6i7I1f6b label A tag, or a source, a target, or a link introduction placed in a node z18697l7239d2999e3k20\bg5B1f7 2i5I5i6I4i6I7i4I1i12I13i4I1f6b link The cross product of a source and a target; in general, a link is a set of (source, target) pairs; in the special case when there is exactly one source and one target, a link behaves like a directed arc between a pair of nodes z18697l7239d2999e3jk20\bg4B1f7 23i6I7i6I179i5I1f6b link introduction The appearance of LINKS id in a node, where id is the main identifier of a linkz18697l7239d2999e3jk20\bg17B1f7 18f1 5f7 9i4I23i10I6i4f6bI literal A representation of a value of a primitive type in a script z18697l7239d2999e3k20\bg7B1f7 22i5I7i14I6i6I1f6b local binding A binding of a value to a name, causing the current environment to be updated with the new attribute; any outer binding's scope will resume at the end of the innermost containing node z18697l7239d2999e3jk20\bg13B1f7 2i7I6i5I6i4I22i11I28i9I22i5I52i4I2f6b name A sequence of identifiers internally separated by periods; e.g., a.b.c z18697l7239d2999e3k20\bg4B1f7 14i11I46f6b nested environment The initial environment of a node contained in another node z18697l7239d2999e3k20\bg18B1f7 12i11I6i4I27f6b NIL A name for the empty value; it does not lengthen a vector or node in which it appears z18697l7239d2999e3k20\f7bg3f6B1f7 21i5I25i6I4i4I21f6b node Everything between a matched pair of {}s in a script; this generally represents a branch point in a document's dominant structurez18697l7239d2999e3jk20\bg4B1f7 46i6I48i10I1i18f6bI NULL Identifies the empty environment; the value it associates with any identifier is NIL z18697l7239d2999e3jk20\f7bg4f6B1f7 21i11I7i5I24i10I4i3I1f6b OUTER A standard attribute of every environment:z18697l7239d2999e3jk20\f7bg5f6B1f7 11i9I10i For a free-standing environment (i.e., a record-like, structured value), OUTER=NULL z18697l7616e3jk20\f7g6i25I For a nodal environment, OUTER's value is the environment of the current node's parent just prior to the start of the current node.z18697l7616e3jk20\f7g6i17I23i11I69i4I For the root node of a document, OUTER=X.z18697l7616e3jk20\f7g39i1I For X, OUTER=NULLz18697l7616e3jk20\f7g4i1I global binding A kind of binding (indicated by ":=") that modifies the environment of the root node of a document only, and hence may endure beyond the end of the current node and may be seen by nodes to the right of the current node, even those not hierarchically descended from the current node. z18697l7239d2999e3jk20\bg14B1f7 10i7I267f6b primitive type Boolean, Integer, Real, String, or Universal z18697l7239d2999e3k20\bg14B1f7i7I2i7I2i4I2i6I5i9I2f6b primitive value A literal or a node, vector, or environment containing only primitive values z18697l7239d2999e3jk20\bg15B1f7 2i7I6i4I2i6I5i11I35f6b private encoding One of a number of non-standard encodings of a script z18697l7239d2999e3k20\bg16B1f7 32i9I6i6I1f6b property Each tag on a node labels it with a property; the properties of a node determine how it may be viewed and edited z18697l7239d2999e3jk20\bg8B1f7 5i3I6i4I1i6I11i8I6i10I6i4I44f6b quoted expression A value which is an expression bracketted by single quotes ("'"); the expression is evaluated in each environment in which the identifier to which it is bound is invoked z18697l7239d2999e3jk20\bg17B1f7 2i5I13i10I72i11I14i10I16i5I4i7I1f6b real A floating point number z18697l7239d2999e3k20\bg4B1f7 24f6b scope The region of the script in which invocations of the attribute named in a binding yield its value; the scope starts textually at the end of the binding, and generally terminates at the end of the innermost containing node z18697l7239d2999e3jk20\bg5B1f7 18i6I10i11I8i9I12i7I11i5I6i5I36i7I66i4I1f6b script An Interscript program; the interchangeable result of externalizing a document z18697l7239d2999e3jk20\bg6B1f7 3i11I40i13I3i8I1f6b selection A conditional form in a script that denotes one of two expressions, depending on the value of a Boolean expression in the current environmentz18697l7239d2999e3jk20\bg9B1f7 24i6I25i11I30i7I27i11f6bI source The set of nodes with REF link, which thereby refer to the set of target links. z18697l7239d2999e3k20\bg6B1f7 11i5I6f1 4f7i4I36i13I2f6b string A literal which is a vector of characters bracketed by "<>", e.g., z18697l7239d2999e3jk20\bg6B1f7 2i7I12i6I60f6b style A quoted expression to be invoked in a node to modify the node's environment, labels, or contents z18697l7239d2999e3jk20\bg5B1f7 2i17I20i4I22i11I2i6I5i8I1f6b Sub A standard component of each environment, which is implicitly invoked to initialize nested environments z18697l7239d2999e3jk20\bg3B1f7 29i11I44i19I1f6b SUBSCRIPT A function that can be used to extract a value from a vector, e.g. SUBSCRIPT[(a b ), 3] is the value z18697l7239d2999e3k36\f7bg9f6B1f7 54i6I53f6b tag A universal name labelling a node using the syntax universal$; the properties of a node correspond to the set of tags labelling it z18697l7239d2999e3jk20\bg3B1f7 2i24I3i4I34i10I54f6b target The set of nodes labelled with link: z18697l7239d2999e3k20\bg6B1f7 11i5I1i8I6i4I2f6b transparency A characteristic of scripts that allows an editor to identify the nodes of a script that it understands and thereby enables it to operate on those nodes without disturbing the ones that it doesn't understand z18697l7239d2999e3jk20\bg12B1f7 20i7I39i5I138f6b Units A set of definitions relating various typographical and scientific units to the Interscript standard units, meters; e.g., inch=2.54E2*meter, pt=.013836*inch z18697l7239d2999e3jk20\bg5B1f7 9i11I60i11I70f6b universal An identifier formed entirely of uppercase letters and digits z18697l7239d2999e3jk20\bg9B1f7 3i10I49f6b value A primitive value, node, vector, environment, universal, or quoted expression z18697l7239d2999e3k20\bg5B1f7 2i15I2i4I2i6I2i11I2i9I5i17I1f6b vector An ordered sequence of values that may be subscripted z18697l7239d2999e3\bg6B1f7 23i6I13i11I1f6b X The standard outer environment for an entire script; the value of an unbound identifier in X is the universal consisting of the same letters in upper casez18697l7239d2999e3jk20\f7bg1f6B1f7 19i11I15i6I6i5I15i11I12i9I45f6b APPENDIX B ARBITRARY CHOICESz18697y684x2e24ck648(635)\bg1f7 7f6 5f7 9f6 1f7 6f6 "One of the primary purposes of a standard is to be definitive about otherwise arbitrary choices."e9c\f5g There are many places in this proposal where we have made an arbitrary choice for definiteness. It will be important that the ultimate standard make some choice on these points; it matters little whether it is the same as ours. To forestall profitless debate on these points, we have tried to list some of the choices that we believe can be easily changed at a later date:e9j\g149i4I Encoding choices:e9j\ig17I The choice of representations for literals (we generally followed Interpress here).l4269e9j\g The selection of particular characters for particular kinds of bracketting, and for particular operators.l4269e9j\g The choice of infix and functional notation for the interchange encoding (as opposed, e.g., to Polish postfix).l4269e9j\g The choice of particular identifiers for basic concepts.l4269e9j\g Linguistic choices:e9j\ig19I The choice of a particular set of basic operators for the language.l4269e9j\g The particular set of primitive data types (we followed Interpressits set seems about as small as will suffice).l4269e9j\g The choice of particular syntactic sugars for common linguistic forms.l4269e9j\g APPENDIX C FORMAL SEMANTICSz18697y684x2e24ck648\bg1f7 7f6 5f7 5f6 2f7 8f6 C.1. Grammarz18697x2e24\bg3B2b Our notation is basically BNF with terminals quoted and augmented by the following conventions:z18697d3634x3e12j\g a sequence enclosed in [ ] brackets may occur zero or one times;z18697l4269x2e4j\g23f0 4f6 a construct followed by * may occur zero or more times;z18697l4269x2e4j\g24f0 1f6 parentheses ( ) are used purely for grouping.z18697l4269x2e4j\g12f0 3f6 script ::= header node trailerx3e12j(0,5088)(1,65535)\f0g7f6 4f0 header ::= "Interscript/Interchange/1.0 "e3j\f0g7f6 4f0 28f3 1f0 trailer ::= "EndScript"e3j\f0g item ::= content | binding | labele3j\f0g5f6 4f0 content ::= term | nodee3j\f0g8f6 4f0 term ::= primary | primary op terme3j\f0g5f6 4f0 op ::= "+" | "" | "*" | "/"e3j\f0g3f6 4f0 primary ::= literal | invocation | indirection | application | selection | vectore3j\f0g8f6 4f0 literal ::= Boolean | integer | real | string | universale3j\f0g8f6 4f0 invocation ::= namee3j\f0g11f6 4f0 name ::= id ( "." id )*e3j\f0g5f6 4f0 indirection ::= name "%"e3j\f0g12f6 4f0 application ::= ( name | universal ) "[" item* "]"e3j\f0g12f6 4f0 universal ::= ucIDe3j\f0g10f6 4f0 selection ::= "(" term "|" item* "|" item* ")"e3j\f0g10f6 4f0 13f6 4f0 6f6 4f0 vector ::= "(" item* ")"e3j\f0g7f6 4f0 4f6 4f0 node ::= "{" item* "}"e3j\f0g5f6 4f0 4f6 4f0 binding ::= localBind | globalBind localBind ::= name "_" rhs globalBind ::= ( name | universal ) ":=" rhse3j\f0g rhs ::= content | op term | "'" item* "'" | "[" item* "|" binding* "]"e3j\f0g4f6 4f0 24f6 4f0 label ::= tag | linke3j\f0g6f6 4f0 tag ::= universal "$"e3j\f0g4f6 4f0 link ::= "LINKS" id | "^" name | name ":"e3j\f0g5f6 4f0 1f1 5f0 C.2. Notation for environmentsz18697x2e24k108(635)\bg Environments bind identifiers to expressions, in various modes ("=", ":=", "_"):e12\g NULL denotes the "empty" environmentl4269\f7g4f6 [E | id _ e] means "E with id bound to e"l4269\g1i1I3i2I3i1I9i1I6i2I10i1I locVal(id, E) denotes the value locally bound to id in El4269\ig6I1i2I2i1I37i2I4i1I locVal(id, NULL) = NIL = ""l5539\ig6I1i2I2f7 4f6 4f7 3f6 locVal(id, [E | id' m e]) = if id=id' then e else locVal(id, E)l5539\ig6I1i2I3i1I3i3I3i1I8i2I1i3I6i1I6i6I1i2I2i1I C.3. Semantic functionsz18697x2e24k108\bg R: expression, environment --> expression -- Reductionx3e12\g R is used for evaluating right-hand sides: identifiers, expressions, etc.l4269x3e3j\g C: expression --> expression -- Contentsx3e12\g C is basically used to indicate which evaluated expressions become part of the content of a node l4269x3e3j\g B: expression, environment --> environment -- Bindingsx3e12\g B indicates the effect a binding has on an environment. B and R are mutually recursive functions (e.g., the evaluation of an expression may cause some bindings to occur as well)l4269x3e3j\g The following four semantic functions occur less frequently in any substantive way in the semantics below. You might wish to skip them until they occur in a nontrivial manner in the semantics.x3e12j\g T: expression --> expression -- Tagsx3e12\g T indicates when an identifier is to be included in the tag set for a nodel4269x3e3j\g L: expression --> expression -- Linksx3e12\ig1I L indicates link declarationsl4269x3e3j\ig1I Ls: expression --> expression -- Link sourcesx3e12\ig1o252 1o0I Ls indicates a link to the set of nodes having associated target linksl4269x3e3j\ig1o252 1o0I Lt: expression --> expression -- Link targetsx3e12\ig1o252 1o0I Lt indicates that the node is to be included in the target set of all the names which are prefixes of the name to which the expression should evaluatel4269x3e3j\ig1o252 1o0I C.4. Presentation by featurez18697x2e24k108\bg [E is used to represent the value of the environment in which the feature occurs.]x3e12j\g1i1I script ::= header node trailer header ::= "Interscript/Interchange/1.0 " trailer ::= "EndScript"e12\f0g7f6 3f0 29f6 4f0 28f3 1f0 The semantics of the root node of a script are equivalent to the following general semantics for a node with the initial environment being the outermost, external environment X instead of E:z18697l3008x3e3j(0,6816)\g175f7 1f6 12i1I node ::= "{" item* "}" R = C = "{" R<"Sub" item*>([NULL | "OUTER" "=" E]) "}" B = locVal("OUTER", (B<"Sub" item*>([NULL | "OUTER" "=" E]))) T = L = Ls = Lt = NILe12(635)\ig4I9i4I7i1I3i1I7i1I7i4I4f7 4f6 4f7 5f6 6i1I8i1I3i6I2f7 5f6 4i1I7i4I4f7 4f6 4f7 5f6 6i1I6i1I3i1I3i1o252 1o0I3i1o252 1o0I3f7 3f6 Nodes have nested environments, and can have more global effects only through global (:=) bindings. The items of a node are implicitly prefixed with the identifier Sub, which may be bound to any information intended to be common to all subnodes in a scope.z18697l3008x3e3j(0,6816)\g item* ::= "" R = C = T = L = Ls = Lt = NIL B = Ee12(635)\ig4I10i1I3i1I3i1I3i1I3i1o252 1o0I3i1o252 1o0I3f7 3f6 2i1I3i1I The empty sequence of items has no value and no effect; this is the basis for the following recursive definition.x3e3j\g item* ::= item1 item* R = R(E) R(B(E)) B = B(B(E)) For F in {C, T, L, Ls, Lt}: F = F Fe12\ig4I6i5I1i4I3i1I3i1I1i5I2i1I2i1I1i4I3i1I1i5I2i1I4i1I3i1I1i4I3i1I1i5I2i1I11i1I5i1I2i1I2i1I2i1o252 1o0I2i1o252 1o0I4i1I3i1I1i5I2i1I1i4I In general, the value of a sequence of items is just the sequence of item values; binding items affect the environment of items to their right; NIL does not change the length of a result sequence.x3e3j\g144f7 3f6 term ::= primary op term op ::= "+" | "-" | "*" | "/" R = C = R(E) op R(E) B = E T = L = Ls = Lt = NILe12\ig4I5i15I1i2I28i1I3i1I3i1I1i7I2i1I2i2I1i1I1i4I2i1I3i1I3i1I2i1I3i1I3i1o252 1o0I3i1o252 1o0I3f7 3f6 Both the primary and the term must reduce to numbers; the arithmetic operators are evaluated right-to-left (a la APL, without precedence) and bind less tightly than application.x3e3j\g primary ::= literal literal ::= Boolean | integer | hexint | real | string R = C = literal B = E T = L = Ls = Lt = NILe12\ig7I5i7I1i7I5i7I3i7I3i6I3i4I3i6I2i1I3i1I3i7I2i1I3i1I2i1I3i1I3i1o252 1o0I3i1o252 1o0I3f7 3f6 The basic contents of a document.z18697l3008x3e3j(0,6816)\g invocation ::= id R = R(E) B = B(E) where valOf(id, E) = locVal(id, whereBound(id, E)) -- Gets innermost value whereBound(id, E) = CASE -- Gets innermost binding locBinding(id, E) ~= NONE => E locBinding("OUTER", E) ~= NONE => whereBound(id, locVal("OUTER", E)) True => NULLe12(635)\ig10I5i2I2i1I3i1I1i5I1i2I2i1I3i1I3i1I3i1I1i5I1i2I2i1I3i1I13i5I1i2I2i1I4i6I1i2I2i10I1i2I2i1I28i10I1i2I2i1I4f7 4f6 31i10I1i2I2i1I5f7 4f6 4i1I3i10I2f7 5f6 3i1I5f7 4f6 10i10I1i2I2i6I2f7 5f6 3i1I16f7 4f6 Both attributes and definitions are looked up in the current environment; depending on the current binding of id, this may produce values and/or bindings; if the binding's rhs was quoted, the expression is evaluated at the point of invocation.x3e3j\g110i2I60i3I When an id is referred to and locBinding(id, E)=NONE, then the value is sought recursively in locVal("OUTER"). The outermost environment, X, binds each id to the "universal" name which is the uppercase equivalent of id.x3e3j\g8i2I20i10I1i2I2i1I2f7 4f6 42i6I2f7 5f6 32i1I13i2I62i2I invocation ::= name "." id R = R(E))>(E) B = B(E))>(E)e12k36\ig10I5i4I5i2I3i1I3i1I1i5I1i2I2i1I7i1I4i1I3i1I3i1I1i5I1i2I2i1I7i1I4i1I Qualified names are treated as "nested" environments.x3e3j\g universal ::= ucID R = C = ucID B = E T = L = Ls = Lt = NILe12\ig9I5i4I2i1I3i1I3i4I2i1I3i1I2i1I3i1I3i1o252 1o0I3i1o252 1o0I3f7 3f6 Uppercase-only identifiers are presumed to be directly meaningful and are not looked up in the environment.x3e3j\g application ::= invocation "[" item* "]" R = apply(invocation, R(E), E) B = E where apply(invocation, value*, E) = CASE R(E) OF "EQUAL" => value1 = value2 "GREATER" => value1 > value2 . . . "SUBSCRIPT" => value1[value2] -- value1: sequence, value2: int "CONTENTS" => "(" C ")" "TAGS" => "(" T ")" "LINKS" => "(" L ")" "SOURCES" => "(" Ls ")" "TARGETS" => "(" Lt ")" ELSE => R([[NULL | "OUTER" "=" E] | "Value" "=" value*]) inner("{" value* "}") = value*e12\ig11I5i10I5i4I7i1I3i5I1i10I2i1I1i4I3i1I3i1I3i1I3i1I12i5I1i10I2i5I3i1I9f7 4f6 1i1I1i10I2i1I2f7 2f6 4f7 5f6 5i6I3i6I4f7 7f6 5i6I3i6I12f7 9f6 5i6I1i6I38f7 8f6 11i5I1i6I10f7 4f6 11i5I1i6I10f7 5f6 11i5I1i6I10f7 7f6 9i1o252 1o0I1i5I1i6I10f7 7f6 9i1o252 1o0I1i5I19f7 4f6 6i1I1i10I4f7 4f6 4f7 5f6 6i1I16i5I5i5I5i5I9i5I If the invocation does not evaluate to one of the standard external function names, the current environment is augmented with a binding of the value of the argument list to the identifier Value, and the value is the result of the invocation in that environment; this allows function definition within the language.x3e3j\g7i10I171i5I selection ::= "(" term "|" item1* "|" item2* ")" R = if R(E) then R(E) else R(E) B = if R(E) then B(E) else B(E)e12\ig9I9i4I5i5I6i5I7i1I6i1I1i4I2i1I7i1I1i5I3i1I7i1I1i5I3i1I3i1I6i1I1i4I2i1I7i1I1i5I3i1I7i1I1i5I3i1I The notation for selections (conditionals) is borrowed from Algol 68: ( | | ) This is consistent with our principles of using balanced brackets for compound constructions and avoiding syntactically reserved words; the true part and false part may each contain an arbitrary number of items (including none). x3e3j\g74i4I5i9I5i10I144i9I5i10I sequence ::= "(" item* ")" R = C = "(" R(E) ")" B = B(E) T = L = Ls = Lt = NILe12\ig8I9i4I7i1I3i1I7i1I1i4I3i1I7i1I3i1I1i4I3i1I3i1I3i1I3i1o252 1o0I3i1o252 1o0I3f7 3f6 Parentheses group a sequence of items as a single value; bindings in the sequence affect the environment of items to the right in the containing node, but labels are disallowed. Parentheses may also be used to override the right-to-left evaluation of arithmetic operators; an operand sequence must reduce to a single numeric value. x3e3j\g binding ::= name "_" rhs R = NIL B = localBind(name, R(E), E) where localBind(id, value, E) = [E | id _ value] localBind(id "." name, value, E) = [E | id _ localBind(name, value, valOf(id, E))]e12\ig7I5i4I1i3I1i3I2i1I3f7 3f6 2i1I3i9I1i4I2i1I1i3I2i1I3i1I13i10I1i2I2i5I2i1I5i1I3i3I1i6I3i10I1i2I5i4I2i5I2i1I5i1I3i2I3i9I1i4I2i5I2i5I1i2I2i1I This adds a single binding to E; bindings have no other "side effects" and no value.x3e3j\g30i1I binding ::= universal ":=" rhs binding ::= name ":=" rhs R = NIL B = globalBind(name, R(E), E) where globalBind(name, value, E) = if locVal("OUTER", E)=NIL then localBind(name, value, E) else [E | "OUTER" _ globalBind(name, value, locVal("OUTER", E))]e12\ig8I3i12I2i13I5i4I1i1I2i1I1i3I2i1I3f7 3f6 2i1I3i10I1i4I2i1I1i3I2i1I3i1I11i10I1i4I2i5I2i1I11i6I2f7 5f6 3i1I2f7 3f6 7i9I1i14I12i1I4f7 5f6 4i10I1i4I2i5I2i6I2f7 5f6 3i1I Each environment, E, initially contains only its "inherited" environment (bound to OUTER). Most bindings take place directly in E. To allow for "global" bindings, the value of a globalBind(name, R(E), E) will change E by rebinding id in the outermost environment X (reached in the semantics by following the OUTER path from E until the outermost one is reached; if we started in a nodal environment, this will be X).x3e3j\g18i1I64f7 5f6 41i1I50i10I1i4I2i1I1i3I2i1I3i1I14i1I14i2I17i1I12f7 1f6 44f7 5f6 11i1I88f7 1f6 2f1 Note that a global binding to some variable b does not guarantee that using b in a rhs context will result in accessing the global b because a local binding to b may intervene.x3e3j\f7g Note that in a context such as [ | a := 7], the effect of the above semantics is the same as [ | a _ 7].x3e3j\f7g binding ::= name mode op term = e12\ig7I5i17I5i22I This is just a convenient piece of syntactic sugar for the common case of updating a binding.x3e3j\g rhs ::= "'" item* "'" R = item*e12\ig3I9i4I7i1I3i4I If the rhs of a binding is surrounded by single quotes, it will be evaluated in the environments where the name is invoked, rather than the environment in which the binding is made.x3e3j\g7i3I rhs ::= "[|" binding* "]" R = [B([NULL | "OUTER" "=" E]) | "OUTER" "=" NULL]e12\g1i3I10i7I7i1I4i1I1i7I4f7 4f6 4f7 5f6 6i1I6f7 5f6 6f7 4f6 This creates a new environment value that may be used much like a record.x3e3\g rhs ::= "[" invocation "|" binding* "]" R =[B([R(E) | "OUTER" "=" E]) | "OUTER" "=" NULL]e12\ig3I9i10I5i7I11i1I1i7I4i1I1i10I2i1I5f7 5f6 6i1I6f7 5f6 6f7 4f6 This creates a new environment value that is an extension of an existing one.z18697l3008x3e3j(0,6816)\g tag ::= universal "$" R = R(E) B = B(E) T = universal C = L = Ls = Lt = NILe12(635)\ig3I5i9I6i1I3i1I1i5I1i9I2i1I3i1I4i1I3i1I1i5I1i9I2i1I3i1I3i1I3i9I2i1I3i1I3i1o252 1o0I3i1o252 1o0I3f7 3f6 This gives the containing node the property denoted by the universal and also invokes the universal in the outermost environment (if it is not bound there, NIL will be produced, which contributes nothing to R).x3e3j\g156f7 3f6 48i1I link ::= "LINKS" id R = "LINKS" id L = id B = E C = T = Ls = Lt = NILe12\ig4I6f1 5f6 2i2I2i1I4f1 5f6 2i2I2i1I3i2I2i1I3i1I2i1I3i1I3i1o252 1o0I3i1o252 1o0I3f7 3f6 This defines the scope of the set of links whose "main" component is id.x3e3j\g69i2I A label N: on a node makes that node a "target" of the link N (and its prefixes); a reference ^N makes it a "source." The "main" identifier of a link must be declared (using LINKS id) at the root of a subtree containing all its sources and targets. The link represents a set of directed arcs, one from each of its sources to each of its targets. Multiple target labels make a node the target of multiple links. A target label that appears only on a single node places it in a singleton set, i.e., identifies it uniquely.x3e3j\g8i1I51i1I34i1I79f1 6f6i2I link ::= "^" name R = "^" name Ls = name B = E C = T = L = Lt = NILe12\ig4I9i4I2i1I7i4I2i1o252 1o0I3i4I2i1I3i1I2i1I3i1I3i1I3i1o252 1o0I3f7 3f6 This identifies the containing node as a "source" of the link name.x3e3j\g57i4I link ::= name ":" R = name ":" Lt = prefixes(name) B = E C = T = L = Ls = NILe12\ig4I5i4I6i1I3i4I6i1o252 1o0I3i8I1i4I3i1I3i1I2i1I3i1I3i1I3i1o252 1o0I3f7 3f6 wheree3\g prefixes(id) = id prefixes(name "." id) = name "." id prefixes(name)l4269e3\ig8I1i2I4i2I1i8I1i4I5i2I4i4I5i2I1i8I1i4I This identifies the containing node as a "target" of each of the links that is a prefix of name.x3e3j\g91i4I C.5. Discussionz18697x2e24k108\bg Each script is evaluated in the context of an initial environment, X, which can contain attributes global to all scripts, attributes that specify values for system-specific identifiers, and in which all global bindings are made.x3e12j\g67i1I Each environment, E, initially contains only its "inherited" environment (bound to the OUTER). Most bindings take place directly in E. To allow for more persistent bindings, the value of a bind(id, ":=", val, E) will change E by rebinding id in X. For the root node of a script, OUTER = X.x3e12j\g18i1I68f7 5f6 41i1I57i4I1i2I8i3I2i1I14i1I14i2I4i1I34f7 5f6 3i1I If the right-hand side of a binding is surrounded by single quotes, it will be evaluated in the environments where the name is invoked, rather than the environment in which the binding is made.x3e12j\g When an id is referred to and locBinding(id, E)=NONE, then the value is sought recursively in locVal("OUTER"). The X environment binds each id to the "universal" name which is its uppercase equivalent (e.g., the universal for iDentiFieR is IDENTIFIER).x3e12j\g8i2I20i10I1i2I2i1I2f7 4f6 42i6I2f7 5f6 9i1I Nodes are delimited by brackets. The contents of each node are implicitly prefixed by Sub, which will generally be bound in the containing environment to a quoted expression performing some bindings, and perhaps supplying some labels (tags and links).x3e12j\g Parentheses are used to delimit sequence values. Square brackets are used to delimit the argument list of an operator application and to denote environment constructors, which behave much like records.x3e12j\g Expressions involving the four infix ops (+, -, *, /) are evaluated right-to-left (a la APL); since we expect expressions to be short, we have not imposed precedence rules.x3e12j\g The notation for selections (conditionals) is borrowed from Algol 68: ( | | ) This is consistent with our principles of using balanced brackets for compound constructions and avoiding syntactically reserved words; the true part and false part may each contain an arbitrary number of items (including none). x3e12j\g A label N: on a node makes that node a "target" of the link N (and its prefixes); a reference ^N makes it a "source." The "main" identifier of a link must be declared (using LINKS id) at the root of a subtree containing all its sources and targets. The link represents a set of directed arcs, one from each of its sources to each of its targets. Multiple target labels make a node the target of multiple links. A target label that appears only on a single node places it in a singleton set, i.e., identifies it uniquely.x3e12j\g176f1 6f6 C.6. Grammatical feature X Semantic function matrixz18697x2e24k144\bg LEGEND: - Semantic function produces NIL or E or does not apply. + Non-trivial semantic equation. =For R: passes value unchanged; for C: value same as R.z18697l3008x3e12j(0,6816)\g37f7 3f6 FEATURES: FUNCTIONS: R C B T L Ls Lt term ::= primary op term + = - - - - - primary ::= literal = = - - - - - invocation ::= id + - + - - - - invocation ::= name "." id + - + - - - - universal ::= name "$" = = - - - - - application ::= invocation "[" item* "]" + - - - - - - selection ::= "(" term "|" item1* "|" item2* ")" + - + - - - - node ::= "{" item* "}" + = + - - - - sequence ::= "(" ( value | binding )* ")" + = + - - - - item* ::= item1 item* + + + + + + + binding ::= name mode rhs - - + - - - - rhs ::= "'" item* "'" + - - - - - - rhs ::= "[|" binding* "]" + - - - - - - rhs ::= "[" invocation "|" binding* "]" + - - - - - - tag ::= invocation "%" + - - + - - - link ::= "LINKS" id = - - - + - - link ::= "^" name = - - - - + - link ::= name ":" = - - - - - +x2e12(0,11424)(1,12065)(2,12700)(3,13335)(4,13970)(5,14605)\g37o252 1o0 2o252 1o0 670f1 5f6 - Semantic function produces NIL or E or does not apply. + Non-trivial semantic equation. =For R: passes value unchanged; for C: value same as R. z18697l3008x3e12j(0,6816)(1,65535)(2,65535)(3,65535)(4,65535)(5,65535)\g29f7 3f6 HISTORY LOGz18697y684x2e24ck648(635)\bg1f7 6f6 2f7 2f6 Edited by Mitchell, September 1, 1981 3:12 PM, added first version of glossaryz18697l5440d2999e3(0,6096)(1,7366)\f7g Edited by Mitchell, September 7, 1981 2:11 PM, wrote parts of introductionz18697l5440d2999e3\f7g Edited by Mitchell, September 10, 1981 10:14 AM, added Tab def to Star property sheetsz18697l5440d2999e3\f7g Edited by Mitchell, September 14, 1981 9:54 AM, renumbered chapters and did minor editsz18697l5440d2999e3\f7g Edited by Horning, May 4, 1982 5:16 PM, Fold in Truth Copy changes, add Appendix Bz18697l5440d2999e3\f7g Edited by Mitchell, May 10, 1982 5:40 PM, changed "Interdoc" to "Interscript", "rendering" to "internalizing", and "transcribing" to "externalizing" plus various edits necessitated by these substitutions.z18697l5440d2999e3\f7g Edited by Mitchell, August 19, 1982 4:55 PM, preparing the final version: eliminated const bindings, changed syntax for links, renamed Outermost to be X.z18697l5440d2999e3\f7g60i5I