Link Search Menu Expand Document
\( % cbs-katex.sty % \newcommand{\STYLE}[2]{\htmlClass{cbs-#1}{#2}} \newcommand{\DECL}[3]{\htmlId{#1:#2}{#3}} \newcommand{\REF}[3]{\href{###1:#2}{#3}} \newcommand{\HYPER}[5]{\href{#1/#2/index.html###3:#4}{#5}} % \SHADE{MATH} can be defined to produce a shaded background to highlight % inline MATH in running text: \newcommand{\SHADE}[1]{#1} % \KEY{TEXT}, \STRING{TEXT}, \ATOM{TEXT}, \LEX{TEXT} can be used in math mode: \newcommand{\KEY}[1]{\textsf{\textit{\STYLE{Key}{#1}}}} \newcommand{\STRING}[1]{\textsf{``\texttt{#1}''}} \newcommand{\ATOM}[1]{\textsf{`\texttt{#1}'}} \newcommand{\LEX}[1]{\textsf{\STYLE{Key}{`}\texttt{#1}\STYLE{Key}{'}}} % The following commands produce ASCII characters that are treated specially by LaTeX: \newcommand{\HASH}{\char`\#} \newcommand{\DOLLAR}{\char`\$} \newcommand{\PERCENT}{\char`\%} \newcommand{\AMPERSAND}{\char`\&} \newcommand{\APOSTROPHE}{\char`\'} \newcommand{\BACKSLASH}{\char`\\} \newcommand{\CARET}{\char`\^} \newcommand{\UNDERSCORE}{\char`\_} \newcommand{\GRAVE}{\char`\`} \newcommand{\LEFTBRACE}{\char`\{} \newcommand{\RIGHTBRACE}{\char`\}} \newcommand{\TILDE}{\textasciitilde} % {\char`\~} % \NAME{name} highlights the name; % \NAMEDECL{name} declares Name.name as the target of links to name; % \NAMEREF{name} links name to the target Name.name in the current file; % \NAMEHYPER{url}{file}{name} links name to Name.name at url/file/file.pdf. % Similarly for \VAR{partvariable}, \SYN{syntaxname}, \SEM{semanticsName}, % and \SECT{sectionnumber} % The kerns in \SUB and \VAR avoid overlaps with primes: \newcommand{\SUB}[1]{_{\kern-2mu\STYLE{PartVariable}{\textsf{#1}}}} % PLAIN \newcommand{\VAR}[1]{\STYLE{PartVariable}{\textsf{\textit{#1}\kern2mu}}} \newcommand{\NAME}[1]{\STYLE{Name}{\textsf{#1}}} \newcommand{\SYN}[1]{\STYLE{SyntaxName}{\textsf{#1}}} \newcommand{\SEM}[1]{\STYLE{SemanticsName}{\textsf{#1}}} \newcommand{\SECT}[1]{\STYLE{SectionNumber}{\textsf{#1}}} % DECL \newcommand{\VARDECL}[1]{\DECL{PartVariable}{#1}{\VAR{#1}}} \newcommand{\NAMEDECL}[1]{\DECL{Name}{#1}{\NAME{#1}}} \newcommand{\SYNDECL}[1]{\DECL{SyntaxName}{#1}{\SYN{#1}}} \newcommand{\SEMDECL}[1]{\DECL{SemanticsName}{#1}{\SEM{#1}}} \newcommand{\SECTDECL}[1]{\DECL{SectionNumber}{#1}{\textsf{#1}}} % REF \newcommand{\VARREF}[1]{\REF{PartVariable}{#1}{\VAR{#1}}} \newcommand{\NAMEREF}[1]{\REF{Name}{#1}{\NAME{#1}}} \newcommand{\SYNREF}[1]{\REF{SyntaxName}{#1}{\SYN{#1}}} \newcommand{\SEMREF}[1]{\REF{SemanticsName}{#1}{\SEM{#1}}} \newcommand{\SECTREF}[1]{\REF{SectionNumber}{#1}{\SECT{#1}}} % HYPER \newcommand{\VARHYPER}[3]{\HYPER{#1}{#2}{PartVariable}{#3}{\VAR{#3}}} \newcommand{\NAMEHYPER}[3]{\HYPER{#1}{#2}{Name}{#3}{\NAME{#3}}} \newcommand{\SYNHYPER}[3]{\HYPER{#1}{#2}{SyntaxName}{#3}{\SYN{#3}}} \newcommand{\SEMHYPER}[3]{\HYPER{#1}{#2}{SemanticsName}{#3}{\SEM{#3}}} \newcommand{\SECTHYPER}[3]{\HYPER{#1}{#2}{SectionNumber}{#3}{\SECT{#3}}} % \LEFTPHRASE MATH \RIGHTPHRASE produces [[ MATH ]] with proper brackets: \newcommand{\LEFTPHRASE}{\llbracket} \newcommand{\RIGHTPHRASE}{\rrbracket} % \LEFTGROUP MATH \RIGHTGROUP produces ( MATH ) where the parentheses are % highlighted the same as keywords: \newcommand{\LEFTGROUP}{\STYLE{Key}{(}} \newcommand{\RIGHTGROUP}{\STYLE{Key}{)}} % MATH\PLUS produces a superscript + % MATH\STAR produces a superscript * % MATH\QUERY produces a superscript ? \newcommand{\PLUS}{{}^{\texttt{+}}} \newcommand{\STAR}{{}^{\texttt{*}}} \newcommand{\QUERY}{{}^{\texttt{?}}} % \RULE{& PREMISE \\ & ...}{& FORMULA ... \\ & ...} produces an inference rule % with separately aligned premises and conclusion % PREMISE % ... % ----------- % FORMULA ... % ... \newcommand{\RULE}[2] {\frac{\begin{aligned}#1\end{aligned}}{\begin{aligned}#2\end{aligned}}} % \AXIOM{& FORMULA ... \\ & ...} produces an aligned formula % % FORMULA ... % ... \newcommand{\AXIOM}[1]{\begin{aligned}#1\end{aligned}} % \TO TYPE produces => TYPE \newcommand{\TO}{\mathop{\Rightarrow}} % TERM \TRANS TERM produces TERM ---> TERM \newcommand{\TRANS}{\longrightarrow} % TERM \xrightarrow{LABEL} TERM puts the label above the long arrow % \)

Languages-beta : OC-L-03-Names.cbs | PLAIN | PDF

OUTLINE

\[\KEY{Language} \quad \STRING{OCaml Light}\]

\(\SECT{3}\) Names

Naming objects

\[\begin{align*} \KEY{Syntax} \quad \VARDECL{VN} : \SYNDECL{value-name} \ ::= \ & \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{lowercase-ident} \\ \ \mid \ & \ \LEX{{(}} \ \SYNREF{operator-name} \ \LEX{{)}} \\ \VARDECL{ON} : \SYNDECL{operator-name} \ ::= \ & \ \SYNREF{prefix-op} \mid \SYNREF{infix-op} \\ \VARDECL{PO} : \SYNDECL{prefix-op} \ ::= \ & \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{prefix-symbol} \end{align*}\]
// infix-op ::= infix-symbol  
//            | '*' | '+' | '-' | '-.' | '=' | '<' | '>' | '||' | '&' | '&&'  
//            | '!=' | 'or' | ':=' | 'mod'  
//            | 'land' | 'lor' | 'lxor' | 'lsl' | 'lsr' | 'asr'  

Infix operator precedence

\[\begin{align*} \KEY{Syntax} \quad \VARDECL{IO} : \SYNDECL{infix-op} \ ::= \ & \ \SYNREF{infix-op-1} \mid \SYNREF{infix-op-2} \mid \SYNREF{infix-op-3} \mid \SYNREF{infix-op-4} \\ \ \mid \ & \ \SYNREF{infix-op-5} \mid \SYNREF{infix-op-6} \mid \SYNREF{infix-op-7} \mid \SYNREF{infix-op-8} \\ \KEY{Lexis} \quad \VARDECL{IO-1} : \SYNDECL{infix-op-1} \ ::= \ & \ \LEX{{*}{*}} \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{operator-char}\STAR \mid \LEX{lsl} \mid \LEX{lsr} \mid \LEX{asr} \\ \VARDECL{IO-2} : \SYNDECL{infix-op-2} \ ::= \ & \ \LEX{{*}} \\ \ \mid \ & \ \LEX{{*}} \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{operator-char-not-asterisk} \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{operator-char}\STAR \\ \ \mid \ & \ \LEFTGROUP \LEX{{/}} \mid \LEX{{\PERCENT}} \RIGHTGROUP \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{operator-char}\STAR \\ \ \mid \ & \ \LEX{mod} \mid \LEX{land} \mid \LEX{lor} \mid \LEX{lxor} \\ \VARDECL{IO-3} : \SYNDECL{infix-op-3} \ ::= \ & \ \LEFTGROUP \LEX{{+}} \mid \LEX{{-}} \RIGHTGROUP \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{operator-char}\STAR \\ \VARDECL{IO-4} : \SYNDECL{infix-op-4} \ ::= \ & \ \LEFTGROUP \LEX{{@}} \mid \LEX{{\CARET}} \RIGHTGROUP \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{operator-char}\STAR \\ \VARDECL{IO-5} : \SYNDECL{infix-op-5} \ ::= \ & \ \LEFTGROUP \LEX{{=}} \mid \LEX{{<}} \mid \LEX{{>}} \mid \LEX{{\DOLLAR}} \RIGHTGROUP \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{operator-char}\STAR \\ \ \mid \ & \ \LEX{{|}} \ \LEFTGROUP \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{operator-char-not-bar} \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{operator-char}\STAR \RIGHTGROUP\QUERY \\ \ \mid \ & \ \LEX{{|}{|}} \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{operator-char}\PLUS \\ \ \mid \ & \ \LEX{{\AMPERSAND}} \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{operator-char-not-ampersand} \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{operator-char}\STAR \\ \ \mid \ & \ \LEX{{\AMPERSAND}{\AMPERSAND}} \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{operator-char}\PLUS \\ \ \mid \ & \ \LEX{{!}{=}} \\ \VARDECL{IO-6} : \SYNDECL{infix-op-6} \ ::= \ & \ \LEX{{\AMPERSAND}} \mid \LEX{{\AMPERSAND}{\AMPERSAND}} \\ \VARDECL{IO-7} : \SYNDECL{infix-op-7} \ ::= \ & \ \LEX{or} \mid \LEX{{|}{|}} \\ \VARDECL{IO-8} : \SYNDECL{infix-op-8} \ ::= \ & \ \LEX{{:}{=}} \\ \KEY{Lexis} \quad \VARDECL{CN} : \SYNDECL{constr-name} \ ::= \ & \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{capitalized-ident} \\ \VARDECL{TCN} : \SYNDECL{typeconstr-name} \ ::= \ & \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{lowercase-ident} \\ \VARDECL{FN} : \SYNDECL{field-name} \ ::= \ & \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{lowercase-ident} \\ \VARDECL{MN} : \SYNDECL{module-name} \ ::= \ & \ \SYNHYPER{../.}{OC-L-01-Lexical-Conventions}{capitalized-ident} \end{align*}\]

Referring to named objects

\[\begin{align*} \KEY{Syntax} \quad \VARDECL{VP} : \SYNDECL{value-path} \ ::= \ & \ \SYNREF{value-name} \\ \VARDECL{CSTR} : \SYNDECL{constr} \ ::= \ & \ \SYNREF{constr-name} \\ \VARDECL{TCSTR} : \SYNDECL{typeconstr} \ ::= \ & \ \SYNREF{typeconstr-name} \\ \VARDECL{F} : \SYNDECL{field} \ ::= \ & \ \SYNREF{field-name} \end{align*}\] \[\begin{align*} \KEY{Semantics} \quad & \SEMDECL{value-name} \LEFTPHRASE \ \_ : \SYNREF{value-path} \ \RIGHTPHRASE : \TO \NAMEHYPER{../../../../../Funcons-beta/Computations/Normal}{Binding}{ids} \\ \KEY{Rule} \quad & \SEMREF{value-name} \LEFTPHRASE \ \VARHYPER{../.}{OC-L-01-Lexical-Conventions}{LI} \ \RIGHTPHRASE = \textsf{\textquotedblleft}\VAR{LI}\textsf{\textquotedblright} \\ \KEY{Rule} \quad & \SEMREF{value-name} \LEFTPHRASE \ \LEX{{(}} \ \VARHYPER{../.}{OC-L-01-Lexical-Conventions}{PS} \ \LEX{{)}} \ \RIGHTPHRASE = \NAMEHYPER{../../../../../Funcons-beta/Values/Composite}{Strings}{string-append} ( \STRING{{(}}, \textsf{\textquotedblleft}\VAR{PS}\textsf{\textquotedblright}, \STRING{{)}} ) \\ \KEY{Rule} \quad & \SEMREF{value-name} \LEFTPHRASE \ \LEX{{(}} \ \VARREF{IO-1} \ \LEX{{)}} \ \RIGHTPHRASE = \NAMEHYPER{../../../../../Funcons-beta/Values/Composite}{Strings}{string-append} ( \STRING{{(}}, \textsf{\textquotedblleft}\VAR{IO-1}\textsf{\textquotedblright}, \STRING{{)}} ) \\ \KEY{Rule} \quad & \SEMREF{value-name} \LEFTPHRASE \ \LEX{{(}} \ \VARREF{IO-2} \ \LEX{{)}} \ \RIGHTPHRASE = \NAMEHYPER{../../../../../Funcons-beta/Values/Composite}{Strings}{string-append} ( \STRING{{(}}, \textsf{\textquotedblleft}\VAR{IO-2}\textsf{\textquotedblright}, \STRING{{)}} ) \\ \KEY{Rule} \quad & \SEMREF{value-name} \LEFTPHRASE \ \LEX{{(}} \ \VARREF{IO-3} \ \LEX{{)}} \ \RIGHTPHRASE = \NAMEHYPER{../../../../../Funcons-beta/Values/Composite}{Strings}{string-append} ( \STRING{{(}}, \textsf{\textquotedblleft}\VAR{IO-3}\textsf{\textquotedblright}, \STRING{{)}} ) \\ \KEY{Rule} \quad & \SEMREF{value-name} \LEFTPHRASE \ \LEX{{(}} \ \VARREF{IO-4} \ \LEX{{)}} \ \RIGHTPHRASE = \NAMEHYPER{../../../../../Funcons-beta/Values/Composite}{Strings}{string-append} ( \STRING{{(}}, \textsf{\textquotedblleft}\VAR{IO-4}\textsf{\textquotedblright}, \STRING{{)}} ) \\ \KEY{Rule} \quad & \SEMREF{value-name} \LEFTPHRASE \ \LEX{{(}} \ \VARREF{IO-5} \ \LEX{{)}} \ \RIGHTPHRASE = \NAMEHYPER{../../../../../Funcons-beta/Values/Composite}{Strings}{string-append} ( \STRING{{(}}, \textsf{\textquotedblleft}\VAR{IO-5}\textsf{\textquotedblright}, \STRING{{)}} ) \\ \KEY{Rule} \quad & \SEMREF{value-name} \LEFTPHRASE \ \LEX{{(}} \ \VARREF{IO-6} \ \LEX{{)}} \ \RIGHTPHRASE = \NAMEHYPER{../../../../../Funcons-beta/Values/Composite}{Strings}{string-append} ( \STRING{{(}}, \textsf{\textquotedblleft}\VAR{IO-6}\textsf{\textquotedblright}, \STRING{{)}} ) \\ \KEY{Rule} \quad & \SEMREF{value-name} \LEFTPHRASE \ \LEX{{(}} \ \VARREF{IO-7} \ \LEX{{)}} \ \RIGHTPHRASE = \NAMEHYPER{../../../../../Funcons-beta/Values/Composite}{Strings}{string-append} ( \STRING{{(}}, \textsf{\textquotedblleft}\VAR{IO-7}\textsf{\textquotedblright}, \STRING{{)}} ) \\ \KEY{Rule} \quad & \SEMREF{value-name} \LEFTPHRASE \ \LEX{{(}} \ \VARREF{IO-8} \ \LEX{{)}} \ \RIGHTPHRASE = \NAMEHYPER{../../../../../Funcons-beta/Values/Composite}{Strings}{string-append} ( \STRING{{(}}, \textsf{\textquotedblleft}\VAR{IO-8}\textsf{\textquotedblright}, \STRING{{)}} ) \end{align*}\] \[\begin{align*} \KEY{Semantics} \quad & \SEMDECL{constr-name} \LEFTPHRASE \ \_ : \SYNREF{constr} \ \RIGHTPHRASE : \TO \NAMEHYPER{../../../../../Funcons-beta/Computations/Normal}{Binding}{ids} \\ \KEY{Rule} \quad & \SEMREF{constr-name} \LEFTPHRASE \ \VARREF{CN} \ \RIGHTPHRASE = \textsf{\textquotedblleft}\VAR{CN}\textsf{\textquotedblright} \end{align*}\] \[\begin{align*} \KEY{Semantics} \quad & \SEMDECL{typeconstr-name} \LEFTPHRASE \ \_ : \SYNREF{typeconstr} \ \RIGHTPHRASE : \TO \NAMEHYPER{../../../../../Funcons-beta/Computations/Normal}{Binding}{ids} \\ \KEY{Rule} \quad & \SEMREF{typeconstr-name} \LEFTPHRASE \ \VARREF{TCN} \ \RIGHTPHRASE = \textsf{\textquotedblleft}\VAR{TCN}\textsf{\textquotedblright} \end{align*}\] \[\begin{align*} \KEY{Semantics} \quad & \SEMDECL{field-name} \LEFTPHRASE \ \_ : \SYNREF{field} \ \RIGHTPHRASE : \TO \NAMEHYPER{../../../../../Funcons-beta/Computations/Normal}{Binding}{ids} \\ \KEY{Rule} \quad & \SEMREF{field-name} \LEFTPHRASE \ \VARREF{FN} \ \RIGHTPHRASE = \textsf{\textquotedblleft}\VAR{FN}\textsf{\textquotedblright} \end{align*}\]