Skip to content

Commit

Permalink
Add more terms from glossary
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Dec 9, 2020
1 parent fa926ef commit edb174b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 65 deletions.
24 changes: 19 additions & 5 deletions chapters/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,17 @@ \section{Component Declarations}\label{component-declarations}

Component declarations are described in this section.

A \firstuse{component declaration}\index{component declaration} is an element of a class definition that generates a component.
A component declaration specifies (1) a component name, i.e., an identifier, (2) the class to be flattened in order to generate the component, and (3) an optional \lstinline!Boolean! parameter expression.
Generation of the component is suppressed if this parameter expression evaluates to false.
A component declaration may be overridden by an element-redeclaration.

A \firstuse{component}\index{component} or \firstuse{variable}\index{variable} is an instance (object) generated by a component declaration.
Special kinds of components are scalar, array, and attribute.

\subsection{Syntax and Examples of Component Declarations}\label{syntax-and-examples-of-component-declarations}

The formal syntax of a component declaration clause is given by the
following syntactic rules:
The formal syntax of a component declaration clause is given by the following syntactic rules:
\begin{lstlisting}[language=grammar]
component-clause:
type-prefix type-specifier [ array-subscripts ] component-list
Expand Down Expand Up @@ -504,9 +511,16 @@ \subsection{Conditional Component Declaration}\label{conditional-component-decla

\section{Class Declarations}\label{class-declarations}

Essentially everything in Modelica is a class, from the predefined
classes \lstinline!Integer! and \lstinline!Real!, to large packages such as the Modelica
standard library.
Essentially everything in Modelica is a \firstuse{class}\index{class}, from the predefined classes \lstinline!Integer! and \lstinline!Real!, to large packages such as the Modelica standard library.
The description consists of a class definition, a modification environment that modifies the class definition, an optional list of dimension expressions if the class is an array class, and a lexically
enclosing class for all classes.

The object generated by a class is called an \firstuse{instance}\index{instance}.
An instance contains zero or more components (i.e., instances), equations, algorithms, and local classes.
An instance has a type (\cref{interface-or-type}).
% Commenting out parts from old glossary that seem excessive here.
%Basically, two instances have same type, if their important attributes are the same and their public components and classes have pair wise equal identifiers and types.
%More specific type equivalence definitions are given, e.g., for functions.

\begin{example}
A rather typical structure of a Modelica class is
Expand Down
42 changes: 0 additions & 42 deletions chapters/glossary.tex
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
\chapter{Glossary}\label{glossary}

\glossaryitem{class}: a description that generates an object called instance.
The description consists of a class definition, a modification
environment that modifies the class definition, an optional list of
dimension expressions if the class is an array class, and a lexically
enclosing class for all classes. (See \cref{class-declarations}.)

\glossaryitem{class type} or \glossaryitem{inheritance interface}: property of a
class, consisting of a number of attributes and a set of public or
protected elements consisting of element name, element type, and element
attributes. (See \cref{inheritance-interface-or-class-type}.)

\glossaryitem{component} or \glossaryitem{variable}: an instance (object) generated
by a component declaration. Special kinds of components are scalar,
array, and attribute. (See \cref{component-declarations}.)

\glossaryitem{component declaration}: an element of a class definition that generates a component. A component declaration specifies (1) a component name, i.e., an identifier, (2) the class to be flattened in order to generate the component, and (3) an optional \lstinline!Boolean! parameter expression. Generation of the component is suppressed if this parameter expression evaluates to false. A component declaration may be overridden by an element-redeclaration. (See \cref{component-declarations}.)

\glossaryitem{component reference}: An expression containing a sequence of
identifiers and indices. A component reference is equivalent to the
referenced object, which must be a component. A component reference is
Expand Down Expand Up @@ -84,25 +67,11 @@ \chapter{Glossary}\label{glossary}

\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{inheritance interface} or \glossaryitem{class type}: property of a
class, consisting of a number of attributes and a set of public or
protected elements consisting of element name, element type, and element
attributes. (See \cref{inheritance-interface-or-class-type}.)

\glossaryitem{instance}: the object generated by a class. An instance contains
zero or more components (i.e.\ instances), equations, algorithms, and
local classes. An instance has a type. Basically, two instances have
same type, if their important attributes are the same and their public
components and classes have pair wise equal identifiers and types. More
specific type equivalence definitions are given e.g.\ for functions.

\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{interface}: see type. (See \cref{interface-or-type}.)

\glossaryitem{literal}: a real, integer, boolean, enumeration, or string
literal. Used to build expressions. (See \cref{literal-constants}.)

Expand All @@ -117,10 +86,6 @@ \chapter{Glossary}\label{glossary}
class defines how to modify the corresponding class definition when
flattening the class. (See \cref{modification-environment}.)

\glossaryitem{name}: Sequence of one or more identifiers. Used to reference a
class. A class name is resolved in the scope of a class, which defines a
set of visible classes. Example name: \lstinline!Ele.Resistor!. (See \cref{names}.)

\glossaryitem{operator record}: A record with user-defined operations;
defining e.g.\ multiplication and addition see \cref{overloaded-operators}.

Expand Down Expand Up @@ -177,11 +142,6 @@ \chapter{Glossary}\label{glossary}
referenced class, or any of its base classes or constraining types
transitively at any level. (See \cref{transitively-non-replaceable}.)

\glossaryitem{type} or interface: property of an instance, expression, consisting of a number of attributes and a set of public
elements consisting of element name, element type, and element
attributes. Note: The concept of class type is a property of a class
definition. (See \cref{interface-or-type}.)

\glossaryitem{variability}: property of an expression: one of
\begin{itemize}
\item \glossaryitem{continuous}: an expression that may change its value at any
Expand All @@ -198,7 +158,5 @@ \chapter{Glossary}\label{glossary}
variability constraint: The expression must not have a higher
variability than component x. (See \cref{variability-of-expressions}.)

\glossaryitem{variable}: synonym for component. (See \cref{component-declarations}.)

\glossaryitem{vector}: an array where the number of dimensions is 1. (See
\cref{arrays}.)
17 changes: 5 additions & 12 deletions chapters/interface.tex
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,8 @@ \section{The Concepts of Type, Interface and Subtype}\label{the-concepts-of-type

\section{Interface or Type}\label{interface-or-type}

Based on a flattened class or component we can construct an interface
for that flattened class or component. The interface or type
(the terms \emph{interface} and \emph{type} are equivalent and can be used
interchangeably) is defined as the following information about the
flattened element itself:
Based on a flattened class or component we can construct an interface for that flattened class or component.
The \firstuse{interface}\index{interface} or \firstuse{type}\index{type} (the terms \emph{interface} and \emph{type} are equivalent and can be used interchangeably, and are different from \emph{inheritance interface} and \emph{class type}) is defined as the following information about the flattened element itself:
\begin{itemize}
\item
Whether it is replaceable or not.
Expand All @@ -145,7 +142,6 @@ \section{Interface or Type}\label{interface-or-type}
Whether it is a component or a class.
\item
Additional information about the element:

\begin{itemize}
\item
The \lstinline!flow! or \lstinline!stream! prefix.
Expand Down Expand Up @@ -235,13 +231,10 @@ \subsection{Transitively non-Replaceable}\label{transitively-non-replaceable}

\subsection{Inheritance Interface or Class Type}\label{inheritance-interface-or-class-type}

For inheritance the interface also must include protected elements; this
is the only change compared to above.
For inheritance, the interface also must include protected elements; this is the only change compared to above.

Based on a flattened class we can construct an inheritance interface or
class type for that flattened class. The inheritance interface or class
type is defined as the following information about the flattened element
itself:
Based on a flattened class we can construct an \firstuse{inheritance interface}\index{inheritance interface}\index{interface!inheritance} or \firstuse{class type}\index{class type}\index{type!class} for that flattened class.
The inheritance interface or class type is defined as the following information about the flattened element itself:
\begin{itemize}
\item
Whether it is replaceable or not.
Expand Down
15 changes: 9 additions & 6 deletions chapters/lexicalstructure.tex
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,15 @@ \subsection{Identifiers}\label{identifiers}

\subsection{Names}\label{names}

A \emph{name} is an identifier with a certain interpretation or meaning.
For example, a name may denote an \lstinline!Integer! variable, a \lstinline!Real! variable, a
function, a type, etc. A name may have different meanings in different
parts of the code, i.e., different scopes. The interpretation of
identifiers as names is described in more detail in \cref{scoping-name-lookup-and-flattening}. The
meaning of package names is described in more detail in \cref{packages}.
A \firstuse{name}\index{name} is an identifier with a certain interpretation or meaning.
For example, a name may denote an \lstinline!Integer! variable, a \lstinline!Real! variable, a function, a type, etc.
A name may have different meanings in different parts of the code, i.e., different scopes.
The interpretation of identifiers as names is described in more detail in \cref{scoping-name-lookup-and-flattening}.
The meaning of package names is described in more detail in \cref{packages}.

\begin{example}
A name: \lstinline!Ele.Resistor!
\end{example}

\subsection{Modelica Keywords}\label{modelica-keywords}

Expand Down

0 comments on commit edb174b

Please sign in to comment.