From 9c7841ec60dde2012987b264fe4737cf5f676fb2 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Fri, 11 Dec 2020 00:18:24 +0100 Subject: [PATCH] Migrate remaining glossary entries --- chapters/arrays.tex | 36 ++++++-------- chapters/classes.tex | 12 ++++- chapters/equations.tex | 4 ++ chapters/functions.tex | 8 ++-- chapters/glossary.tex | 88 ----------------------------------- chapters/inheritance.tex | 9 ++-- chapters/interface.tex | 15 +++--- chapters/lexicalstructure.tex | 41 ++++++---------- chapters/overloaded.tex | 3 +- chapters/scoping.tex | 17 ++++--- 10 files changed, 65 insertions(+), 168 deletions(-) diff --git a/chapters/arrays.tex b/chapters/arrays.tex index ad75ebef2..f012e667e 100644 --- a/chapters/arrays.tex +++ b/chapters/arrays.tex @@ -5,16 +5,13 @@ \chapter{Arrays}\label{arrays} which in the case of matrices has the consequence that all rows in a matrix have equal length, and all columns have equal length. -Each array has a certain dimensionality, i.e., number of dimensions. The -degenerate case of a scalar variable is not really an array, but can be -regarded as an array with zero dimensions. Vectors have one dimension, -matrices have two dimensions, etc. +Each array has a certain dimensionality, i.e., number of dimensions. +The degenerate case of a \firstuse{scalar}\index{scalar} variable is not really an array, but can be regarded as an array with zero dimensions. +\firstuse{Vectors}\index{vector} have one dimension, matrices (sing.\ \firstuse{matrix}\index{matrix}) have two dimensions, etc. - -So-called row vectors and column vectors do not exist in Modelica and cannot be distinguished since vectors have only one -dimension. If distinguishing these is desired, row matrices and column matrices are available, being the corresponding -two-dimensional entities. However, in practice this is seldom needed since the usual matrix arithmetic and linear algebra -operations have been defined to give the expected behavior when operating on Modelica vectors and matrices. +So-called row vectors and column vectors do not exist in Modelica and cannot be distinguished since vectors have only one dimension. +If distinguishing these is desired, row matrices and column matrices are available, being the corresponding two-dimensional entities. +However, in practice this is seldom needed since the usual matrix arithmetic and linear algebra operations have been defined to give the expected behavior when operating on Modelica vectors and matrices. Modelica is a strongly typed language, which also applies to array types. The number of dimensions of an array is fixed and cannot be @@ -31,8 +28,7 @@ \chapter{Arrays}\label{arrays} \section{Array Declarations}\label{array-declarations} -The Modelica type system includes scalar number, vector, matrix (number -of dimensions, ndim=2), and arrays of more than two dimensions. +The Modelica type system includes scalar number, vector, matrix (number of dimensions, ndim=2), and arrays of more than two dimensions. \begin{nonnormative} There is no distinction between a row and column vector. @@ -945,20 +941,16 @@ \subsection{Vector Construction}\label{vector-construction} \section{Array Indexing}\label{array-indexing} -The array indexing operator \emph{name}\lstinline![!\emph{...}\lstinline!]! is used to -access array elements for retrieval of their values or for updating -these values. An indexing operation is subject to upper and lower array -dimension index bounds (\cref{array-dimension-lower-and-upper-index-bounds}). The indexing operator takes two or more -operands, where the first operand is the array to be indexed and the rest of the operands are index expressions: +The array indexing operator \lstinline!$\mathit{name}$[$\ldots$]! is used to access array elements for retrieval of their values or for updating these values. +An indexing operation is subject to upper and lower array dimension index bounds (\cref{array-dimension-lower-and-upper-index-bounds}). +The indexing operator takes two or more operands, where the first operand is the array to be indexed and the rest of the operands are \firstuse{index}\index{index} (or \firstuse{subscript}\index{subscript}) expressions: \lstinline!$\mathit{arrayname}$[$\mathit{indexexpr}_{1}$, $\mathit{indexexpr}_{2}$, $\ldots$]! -A colon is used to denote all indices of one dimension. A vector -expression can be used to pick out selected rows, columns and elements -of vectors, matrices, and arrays. The number of dimensions of the -expression is reduced by the number of scalar index arguments. If the -number of index arguments is smaller than the number of dimensions of -the array, the trailing indices will use `\lstinline!:!'. +A colon (`\lstinline!:!') is used to denote all indices of one dimension. +A vector expression can be used to pick out selected rows, columns and elements of vectors, matrices, and arrays. +The number of dimensions of the expression is reduced by the number of scalar index arguments. +If the number of index arguments is smaller than the number of dimensions of the array, the trailing indices will use `\lstinline!:!'. It is also possible to use the array access operator to assign to element/elements of an array in algorithm sections. This is called an \firstuse{indexed assignment statement}\index{assignment statement!indexed}. diff --git a/chapters/classes.tex b/chapters/classes.tex index 1d0ef9f43..270243a5e 100644 --- a/chapters/classes.tex +++ b/chapters/classes.tex @@ -162,6 +162,7 @@ \subsection{Component Declaration Static Semantics}\label{component-declaration- If the \lstinline[language=grammar]!type-specifier! of the component declaration denotes a built-in type (\lstinline!RealType!, \lstinline!IntegerType!, etc.), the flattened or instantiated component has the same type. +% Seems sufficient to just have \indexinline variant of 'partial' in index. A class defined with \lstinline!partial!\indexinline{partial} in the \lstinline[language=grammar]!class-prefixes! is called a \firstuse{partial} class. Such a class is allowed to be incomplete, and cannot be instantiated in a simulation model; useful, e.g., as a base-class. @@ -214,6 +215,8 @@ \subsubsection{Declaration Equations}\label{declaration-equations} \subsubsection{Prefix Rules}\label{prefix-rules} +A \firstuse{prefix}\index{prefix} is property of an element of a class definition which can be present or not be present, e.g., \lstinline!final!, \lstinline!public!, \lstinline!flow!. + Variables declared with the \lstinline!flow! or the \lstinline!stream! type prefix shall be a subtype of \lstinline!Real!. Type prefixes (that is, \lstinline!flow!, \lstinline!stream!, \lstinline!discrete!, \lstinline!parameter!, \lstinline!constant!, \lstinline!input!, \lstinline!output!) shall only be applied for type, @@ -697,7 +700,7 @@ \subsection{Short Class Definitions}\label{short-class-definitions} \subsection{Restriction on combining base-classes and other elements}\label{restriction-on-combining-base-classes-and-other-elements} -It is not legal to combine other components or base-classes with an extends from an array class, a class with non-empty base-prefix, a simple type (\lstinline!Real!, \lstinline!Boolean!, \lstinline!Integer!, \lstinline!String! and enumeration types), or any class transitively extending from an array class, a class with non-empty base-prefix, or a simple type (\lstinline!Real!, \lstinline!Boolean!, \lstinline!Integer!, \lstinline!String! and enumeration types). +It is not legal to combine other components or base-classes with an extends from an array class, a class with non-empty base-prefix, a \firstuse{simple type}\index{simple type} (\lstinline!Real!, \lstinline!Boolean!, \lstinline!Integer!, \lstinline!String! and enumeration types), or any class transitively extending from an array class, a class with non-empty base-prefix, or a simple type. \begin{example} \begin{lstlisting}[language=modelica] @@ -1306,6 +1309,12 @@ \section{Balanced Models}\label{balanced-models} \section{Predefined Types and Classes}\label{predefined-types-and-classes} +% Not including definition of 'predefined type' from old glossary, since it seems inconsistent with actual use, since, at least +% ExternalObject is also described as a predefined type. +% The definition sounds more like the description of 'simple type'. +%One of the types \lstinline!Real!, \lstinline!Boolean!, \lstinline!Integer!, \lstinline!String! and types defined as \lstinline!enumeration! types. +%The component declarations of the predefined types define attributes such as \lstinline!min!, \lstinline!max!, and \lstinline!unit!. + The \firstuse{attributes}\index{attribute} of the predefined variable types (\lstinline!Real!, \lstinline!Integer!, \lstinline!Boolean!, \lstinline!String!) and \lstinline!enumeration! types are described below with Modelica syntax although they are predefined. All attributes are predefined and attribute values can only be defined using a modification, such as in \lstinline!Real x(unit = "kg")!. Attributes cannot be accessed using dot notation, and are not constrained by equations and algorithm sections. @@ -1324,6 +1333,7 @@ \section{Predefined Types and Classes}\label{predefined-types-and-classes} \end{nonnormative} The definitions use \lstinline!RealType!\indexinline{RealType}, \lstinline!IntegerType!\indexinline{IntegerType}, \lstinline!BooleanType!\indexinline{BooleanType}, \lstinline!StringType!\indexinline{StringType}, \lstinline!EnumType!\indexinline{EnumType} as mnemonics corresponding to machine representations. +These are called the \firstuse{primitive types}\index{primitive type}. \subsection{Real Type}\label{real-type} diff --git a/chapters/equations.tex b/chapters/equations.tex index e28230b8a..635a551db 100644 --- a/chapters/equations.tex +++ b/chapters/equations.tex @@ -7,6 +7,10 @@ \chapter{Equations}\label{equations} % henrikt-ma: Keeping this sentence from the old glossary only because it mentions the 'instantaneous equations': Special cases are: initial equations, instantaneous equations, declaration equations. +% Including definition of 'instantaneous' from old glossary here, even though the term isn't really used outside the introductory chapter. +An equation or statement is \firstuse{instantaneous}\index{instantaneous} if it holds only at events, i.e., at single points in time. +The equations and statements of a when-clause are instantaneous, see \cref{when-equations} and \cref{when-statements}. + \section{Equation Categories}\label{equation-categories} % henrikt-ma: One would have expected this list to also describe the instantaneous equations. diff --git a/chapters/functions.tex b/chapters/functions.tex index c63cc7189..b830981fd 100644 --- a/chapters/functions.tex +++ b/chapters/functions.tex @@ -4,7 +4,7 @@ \chapter{Functions}\label{functions} \section{Function Declaration}\label{function-declaration} -A Modelica function is a specialized class (\cref{function-as-a-specialized-class}) using the keyword \lstinline!function!. +A Modelica \firstuse{function}\index{function} is a specialized class (\cref{function-as-a-specialized-class}) using the keyword \lstinline!function!. The body of a Modelica function is an algorithm section that contains procedural algorithmic code to be executed when the function is called, or alternatively an external function specifier (\cref{external-function-interface}). Formal parameters are specified using the \lstinline!input!\indexinline{input} keyword, whereas results are denoted using the \lstinline!output!\indexinline{output} keyword. This makes the syntax of function definitions quite close to Modelica class definitions, but using the keyword \lstinline!function! instead of \lstinline!class!. @@ -918,10 +918,8 @@ \section{Record Constructor Functions}\label{record-constructor-functions} same name and in the same scope as the record class is implicitly defined according to the following rules: -The declaration of the record is partially flattened including -inheritance, modifications, redeclarations, and expansion of all names -referring to declarations outside of the scope of the record to their -fully qualified names. +% Warning: 'partial flatteing' doesn't seem to be defined. See 'partial instantitation'. +The declaration of the record is partially flattened including inheritance, modifications, redeclarations, and expansion of all names referring to declarations outside of the scope of the record to their fully qualified names. \begin{nonnormative} The partial flattening is performed in order to remove potentially conflicting import-clauses in the record constructor function due to flattening the inheritance tree. diff --git a/chapters/glossary.tex b/chapters/glossary.tex index 7d06e7950..2840c6cd7 100644 --- a/chapters/glossary.tex +++ b/chapters/glossary.tex @@ -1,89 +1 @@ \chapter{Glossary}\label{glossary} - -\glossaryitem{flattening}: the computation that creates a flattened class of a -given class, where all inheritance, modification, etc.\ has been -performed and all names resolved, consisting of a flat set of equations, -algorithm sections, component declarations, and functions. (See \cref{flattening-process}.) - -\glossaryitem{function}: a class of the specialized class function. (See \cref{functions}.) - -\glossaryitem{function subtype} or \glossaryitem{function compatible interface}: A -is a function subtype of B iff A is a subtype of B and the additional -arguments of function A that are not in function B are defined in such a -way (e.g.\ additional arguments need to have default values), that A can -be called at places where B is called. (See \cref{function-compatibility-or-function-subtyping-for-functions}.) - -\glossaryitem{identifier} or ident: an atomic (not composed) name. Example: -\lstinline!Resistor! (See \cref{identifiers-names-and-keywords}.) - -\glossaryitem{index} or \glossaryitem{subscript}: An expression, typically of \lstinline!Integer! type or the colon symbol (\lstinline!:!), used to reference a component (or a range of components) of an array. (See \cref{array-indexing}.) - -\glossaryitem{instantaneous}: An equation or statement is instantaneous if it -holds only at events, i.e., at single points in time. The equations and -statements of a when-clause are instantaneous. (See \cref{when-equations} and -\cref{when-statements}.) - -\glossaryitem{literal}: a real, integer, boolean, enumeration, or string -literal. Used to build expressions. (See \cref{literal-constants}.) - -\glossaryitem{matrix}: an array where the number of dimensions is 2. (See -\cref{arrays}.) - -\glossaryitem{operator record}: A record with user-defined operations; -defining e.g.\ multiplication and addition see \cref{overloaded-operators}. - -\glossaryitem{partial}: a class that is incomplete and cannot be instantiated -in a simulation model; useful e.g.\ as a base-class. (See \cref{component-declaration-static-semantics}.) - -\glossaryitem{partial flattening}: first find the names of declared local -classes and components. Modifiers, if present, are merged to the local -elements and redeclarations are performed. Then base-classes are looked -up, flattened and inserted into the class. See also flattening, which -additionally flattens local elements and performs modifications. (See -\cref{flattening-process}.) - -\glossaryitem{plug-compatibility}: see restricted subtyping and \cref{plug-compatibility-or-restricted-subtyping}. - -\glossaryitem{predefined type}: one of the types \lstinline!Real!, \lstinline!Boolean!, \lstinline!Integer!, -\lstinline!String! and types defined as \lstinline!enumeration! types. The component -declarations of the predefined types define attributes such as \lstinline!min!, \lstinline!max!, -and \lstinline!unit!. (See \cref{predefined-types-and-classes}.) - -\glossaryitem{prefix}: property of an element of a class definition which can -be present or not be present, e.g.\ \lstinline!final!, \lstinline!public!, \lstinline!flow!. (See \cref{prefix-rules}.) - -\glossaryitem{primitive type}: one of the built-in types \lstinline!RealType!, -\lstinline!BooleanType!, \lstinline!IntegerType!, \lstinline!StringType!, \lstinline!EnumType!. The primitive types are -used to define attributes and value of predefined types and enumeration -types. (See \cref{predefined-types-and-classes}.) - -\glossaryitem{redeclare}: the modifier that changes a replaceable element. -(See \cref{redeclaration}) - -\glossaryitem{replaceable}: an element that can be replaced by a different -element having a compatible interface. (See \cref{redeclaration}) - -\glossaryitem{restricted subtyping} or \glossaryitem{plug-compatibility}: a type A -is a restricted subtype of type B iff A is a subtype of B, and all -public components present in A but not in B must be default-connectable. -This is used to avoid introducing, via a redeclaration, an un-connected -connector in the object/class of type A at a level where a connection is -not possible. (See \cref{plug-compatibility-or-restricted-subtyping}.) - -\glossaryitem{scalar} or scalar variable: a variable that is not an array. - -\glossaryitem{simple type:} \lstinline!Real!, \lstinline!Boolean!, \lstinline!Integer!, \lstinline!String! and enumeration types - -\glossaryitem{specialized class}: one of: \lstinline!model!, \lstinline!connector!, \lstinline!package!, \lstinline!record!, \lstinline!block!, \lstinline!function!, \lstinline!type!. The class restriction of a class represents an assertion regarding the content of the class and restricts its use in other classes. For example, a class having the \lstinline!package! class restriction must only contain classes and constants. (See \cref{specialized-classes}.) - -\glossaryitem{subtype} or \glossaryitem{interface compatible}: relation between types. \lstinline!A! is a subtype of (interface compatible with) \lstinline!B! iff a number of properties of \lstinline!A! and \lstinline!B! are the same and all important elements of \lstinline!B! have corresponding elements in \lstinline!A! with the same names and their types being subtypes of the corresponding element types in \lstinline!B!. See also restricted subtyping and function restricted subtyping. (See \cref{interface-compatibility-or-subtyping}.) - -\glossaryitem{supertype}: relation between types. The inverse of subtype. \lstinline!A! is a subtype of \lstinline!B! means that \lstinline!B! is a supertype of \lstinline!A!. (See \cref{interface-compatibility-or-subtyping}.) - -\glossaryitem{transitively nonreplaceable}: a class reference is considered -transitively non-replaceable if there are no replaceable elements in the -referenced class, or any of its base classes or constraining types -transitively at any level. (See \cref{transitively-non-replaceable}.) - -\glossaryitem{vector}: an array where the number of dimensions is 1. (See -\cref{arrays}.) diff --git a/chapters/inheritance.tex b/chapters/inheritance.tex index d39ce2f1e..4ffd8a8ae 100644 --- a/chapters/inheritance.tex +++ b/chapters/inheritance.tex @@ -670,12 +670,9 @@ \subsection{The class extends Redeclaration Mechanism}\label{the-class-extends-r to apply modifiers to the new declaration. \end{nonnormative} -For \lstinline!redeclare class extends B($\ldots$)! the inherited class is subject -to the same restrictions as a redeclare of the inherited element, and -the original class \lstinline!B! should be replaceable, and the new element is only -replaceable if the new definition is replaceable. In contrast to normal -extends it is not subject to the restriction that \lstinline!B! should be -transitively non-replaceable (since \lstinline!B! should be replaceable). +% henrikt-ma: Adding index entry for 'replaceable' here, since I can't find a place where the term is really explained in terms of using the corresponding keyword. +For \lstinline!redeclare class extends B($\ldots$)! the inherited class is subject to the same restrictions as a redeclare of the inherited element, and the original class \lstinline!B! should be \firstuse{replaceable}\index{replaceable}, and the new element is only replaceable if the new definition is replaceable. +In contrast to normal extends it is not subject to the restriction that \lstinline!B! should be transitively non-replaceable (since \lstinline!B! should be replaceable). The syntax rule for \lstinline!class extends! construct is in the definition of the \lstinline!class-specifier! nonterminal (see also class declarations in \cref{class-declarations}): diff --git a/chapters/interface.tex b/chapters/interface.tex index 63c3a0d12..0caea5300 100644 --- a/chapters/interface.tex +++ b/chapters/interface.tex @@ -41,6 +41,8 @@ \section{Interface Terminology}\label{interface-terminology} \end{nonnormative*} \end{definition} +If \lstinline!A! is a subtype of \lstinline!B!, then \lstinline!B! is said to be a \firstuse{supertype}\index{supertype} of \lstinline!A!. + \begin{definition}[Restricted subtype \emph{or} plug compatible interface]\index{restricted subtype}\index{subtype!restricted}\index{plug compatible interface}\index{interface!plug compatible} \lstinline!A! is a restricted subtype of \lstinline!B!, or equivalently, the interface of \lstinline!A! is plug compatible to the interface of \lstinline!B!, if \lstinline!A! is a subtype of \lstinline!B! and if connector components in \lstinline!A! that are not in \lstinline!B!, are default connectable. @@ -204,14 +206,11 @@ \section{Interface or Type}\label{interface-or-type} \subsection{Transitively non-Replaceable}\label{transitively-non-replaceable} \begin{nonnormative} -In several cases it is important that no new elements can be -added to the interface of a class, especially considering short class -definitions. Such classes are defined as transitively -non-replaceable. +In several cases it is important that no new elements can be added to the interface of a class, especially considering short class definitions. +Such classes are defined as \willintroduce{transitively non-replaceable}. \end{nonnormative} -A class reference is transitively non-replaceable iff (i.e.\ \emph{if and -only if}) all parts of the name satisfy the following: +A class reference is \firstuse{transitively non-replaceable}\index{transitively non-replaceable} iff (i.e.\ \emph{if and only if}) all parts of the name satisfy the following: \begin{itemize} \item If the class definition is long it is transitively non-replaceable if @@ -408,8 +407,8 @@ \section{Plug-Compatibility or Restricted Subtyping}\label{plug-compatibility-or If a sub-component is redeclared, see \cref{redeclaration}, it is impossible to connect to any new connector. A connector with \lstinline!input! prefix must be connected to, and since one cannot connect across hierarchies, one should not be allowed to introduce such a connector at a level where a connection is not possible. Therefore all public components present in the interface \lstinline!A! that are not present in \lstinline!B! must be connected by default. \end{nonnormative} -\begin{definition}[Plug-compatibility (= restricted subtyping)]\index{plug-compatibility}% -\index{restricted subtype|seealso{plug-compatibility}}% Can't use 'seealso' in index for some reason, using 'see' as workaround. +\begin{definition}[Plug-compatibility (= restricted subtyping)]% +\index{plug-compatibility}\index{restricted subtype|seealso{plug-compatibility}}% An interface \lstinline!A! is plug-compatible with (a restricted subtype of) an interface \lstinline!B! (or the constraining interface of \lstinline!B!) iff: \begin{itemize} diff --git a/chapters/lexicalstructure.tex b/chapters/lexicalstructure.tex index 525a6df83..a5c4899dd 100644 --- a/chapters/lexicalstructure.tex +++ b/chapters/lexicalstructure.tex @@ -63,29 +63,19 @@ \section{Comments}\label{comments} \section{Identifiers, Names, and Keywords}\label{identifiers-names-and-keywords} -\emph{Identifiers} are sequences of letters, digits, and other -characters such as underscore, which are used for \emph{naming} various -items in the language. Certain combinations of letters are -\emph{keywords} represented as \emph{reserved} words in the Modelica -grammar and are therefore not available as identifiers. +\willintroduce{Identifiers} are sequences of letters, digits, and other characters such as underscore, which are used for \emph{naming} various items in the language. +Certain combinations of letters are \willintroduce{keywords} represented as \emph{reserved} words in the Modelica grammar and are therefore not available as identifiers. \subsection{Identifiers}\label{identifiers} -Modelica \emph{identifiers}, used for naming classes, variables, -constants, and other items, are of two forms. The first form always -starts with a letter or underscore (\_), followed by any number of -letters, digits, or underscores. Case is significant, i.e., the names -\lstinline!Inductor! and \lstinline!inductor! are different. The second form \lstinline!(Q-IDENT)! starts -with a single quote, followed by a sequence of any printable ASCII -character, where single-quote must be preceded by backslash, and -terminated by a single quote, e.g.\ \lstinline!'12H'!, \lstinline!'13\'H'!, -\lstinline!'+foo'!. Control characters in quoted identifiers have to use string -escapes. -The single quotes are part of the identifier, i.e., \lstinline!'x'! and \lstinline!x! -are distinct identifiers. The redundant escapes (\lstinline!'\?'! and \lstinline!'\"'!) are the same as the corresponding non-escaped -variants (\lstinline!'?'! and \lstinline!'"'!), but are only for use in Modelica source code. -A full BNF definition of the Modelica syntax and -lexical units is available in \cref{modelica-concrete-syntax}. +Modelica \firstuse{identifiers}\index{identifier}, used for naming classes, variables, constants, and other items, are of two forms. +The first form always starts with a letter or underscore (`\_'), followed by any number of letters, digits, or underscores. +Case is significant, i.e., the identifiers \lstinline!Inductor! and \lstinline!inductor! are different. +The second form \lstinline!(Q-IDENT)! starts with a single quote, followed by a sequence of any printable ASCII character, where single-quote must be preceded by backslash, and terminated by a single quote, e.g.\ \lstinline!'12H'!, \lstinline!'13\'H'!, \lstinline!'+foo'!. +Control characters in quoted identifiers have to use string escapes. +The single quotes are part of the identifier, i.e., \lstinline!'x'! and \lstinline!x! are distinct identifiers. +The redundant escapes (\lstinline!'\?'! and \lstinline!'\"'!) are the same as the corresponding non-escaped variants (\lstinline!'?'! and \lstinline!'"'!), but are only for use in Modelica source code. +A full BNF definition of the Modelica syntax and lexical units is available in \cref{modelica-concrete-syntax}. \begin{lstlisting}[language=grammar,mathescape=false] IDENT = NONDIGIT { DIGIT | NONDIGIT } | Q-IDENT @@ -118,8 +108,7 @@ \subsection{Names}\label{names} \subsection{Modelica Keywords}\label{modelica-keywords} -The following Modelica \emph{keywords} are reserved words and shall not be -used as identifiers, except as listed in \cref{lexical-conventions}: +The following Modelica \firstuse{keywords}\index{keyword} are reserved words and shall not be used as identifiers, except as listed in \cref{lexical-conventions}: \begin{center} \begin{tabular}{l l l l l} \lstinline!algorithm! & \lstinline!discrete! & \lstinline!false! & \lstinline!loop! & \lstinline!pure!\\ \hline @@ -139,11 +128,9 @@ \subsection{Modelica Keywords}\label{modelica-keywords} \section{Literal Constants}\label{literal-constants} -Literal constants are unnamed constants that have different forms -depending on their type. Each of the predefined types in Modelica has a -way of expressing unnamed constants of the corresponding type, which is -presented in the ensuing subsections. Additionally, array literals and -record literals can be expressed. +\firstuse{Literals}\index{literal} (or \emph{literal constants}) are unnamed constants used to build expressions, and have different forms depending on their type. +Each of the predefined types in Modelica has a way of expressing unnamed constants of the corresponding type, which is presented in the ensuing subsections. +Additionally, array literals and record literals can be expressed. \subsection{Floating Point Numbers}\label{floating-point-numbers} diff --git a/chapters/overloaded.tex b/chapters/overloaded.tex index 23d045d99..6ca0a34f4 100644 --- a/chapters/overloaded.tex +++ b/chapters/overloaded.tex @@ -1,7 +1,6 @@ \chapter{Overloaded Operators}\label{overloaded-operators} -A Modelica \lstinline!operator record! can overload the behavior for -operations such as constructing, adding, multiplying etc. +A Modelica \lstinline!operator record!\indexinline{operator record} can overload the behavior for operations such as constructing, adding, multiplying etc. The overloading is defined in such a way that ambiguities are not allowed and give an error. Furthermore, it is sufficient to define overloading for scalars. diff --git a/chapters/scoping.tex b/chapters/scoping.tex index c70c9c5c1..b4ec1cf73 100644 --- a/chapters/scoping.tex +++ b/chapters/scoping.tex @@ -374,10 +374,7 @@ \section{Simultaneous Inner/Outer Declarations}\label{simultaneous-inner-outer-d \section{Flattening Process}\label{flattening-process} -In order to guarantee that elements can be used before they are declared -and that elements do not depend on the order of their declaration -(\cref{declaration-order-and-usage-before-declaration}) in the enclosing class, the flattening proceeds in the -following two major steps: +In order to guarantee that elements can be used before they are declared and that elements do not depend on the order of their declaration (\cref{declaration-order-and-usage-before-declaration}) in the enclosing class, the \firstuse{flattening}\index{flattening} proceeds in the following two major steps: \begin{enumerate} \item Instantiation process @@ -490,11 +487,13 @@ \subsubsection{Steps of Instantiation}\label{steps-of-instantiation} \paragraph*{The element itself}\label{the-element-itself} -A partially instantiated class or component is an element that is ready -to be instantiated; a partially instantiated element (i.e.\ class or -component) is comprised of a reference to the original element (from the -class tree) and the modifiers for that element (including a possible -redeclaration). +A \firstuse{partially instantiated}\index{partially instantiated} class or component is an element that is ready to be instantiated; a partially instantiated element (i.e.\ class or component) is comprised of a reference to the original element (from the class tree) and the modifiers for that element (including a possible redeclaration). + +% henrikt-ma: The old glossary defined 'partial flattening' as follows -- does it belong here? +%First find the names of declared local classes and components. +%Modifiers, if present, are merged to the local elements and redeclarations are performed. +%Then base-classes are looked up, flattened and inserted into the class. +%See also flattening, which additionally flattens local elements and performs modifications. The possible redeclaration of the element itself takes effect.