Skip to content

Commit

Permalink
Cleanup related to 'connector'
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Oct 12, 2020
1 parent d4ff9d9 commit 185f85a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 41 deletions.
3 changes: 1 addition & 2 deletions chapters/classes.tex
Expand Up @@ -211,8 +211,7 @@ \subsubsection{Declaration Equations}\label{declaration-equations}
component. For declarations of vectors and matrices, declaration
equations are associated with each element.

Only components of the restricted classes type, record, operator record, and connector, or components of classes inheriting from \lstinline!ExternalObject!
may have declaration equations. See also the corresponding rule for algorithms, \cref{restrictions-on-assigned-variables}.
Only components of the restricted classes \lstinline!type!, \lstinline!record!, \lstinline!operator record!, and \lstinline!connector!, or components of classes inheriting from \lstinline!ExternalObject! may have declaration equations. See also the corresponding rule for algorithms, \cref{restrictions-on-assigned-variables}.

\subsubsection{Prefix Rules}\label{prefix-rules}

Expand Down
22 changes: 4 additions & 18 deletions chapters/connectors.tex
Expand Up @@ -14,7 +14,7 @@ \section{Connect-Equations and Connectors}\label{connect-equations-and-connector
\end{lstlisting}

\begin{nonnormative}
A \emph{connector} is an instance of a connector class.
A \emph{connector} is an instance of a \lstinline!connector! class.
\end{nonnormative}

The connect-equation construct takes two references to connectors, each of which is either of the following forms:
Expand Down Expand Up @@ -76,11 +76,7 @@ \subsection{Connection Sets}\label{connection-sets}

\subsection{Inside and Outside Connectors}\label{inside-and-outside-connectors}

In an element instance M, each connector element of M is called an
outside connector with respect to M. All other connector elements that
are hierarchically inside M, but not in one of the outside connectors of
M, is called an inside connector with respect to M. This is done before
resolving \lstinline!outer! elements to corresponding \lstinline!inner! ones.
In an element instance \lstinline!M!, each connector element of \lstinline!M! is called an \firstuse(outside connector} with respect to \lstinline!M!. Any other connector elements that is hierarchically inside \lstinline!M!, but not in one of the outside connectors of \lstinline!M!, is called an \firstuse{inside connector} with respect to \lstinline!M!. This is done before resolving \lstinline!outer! elements to corresponding \lstinline!inner! ones.

\begin{example}
\begin{figure}[H]
Expand Down Expand Up @@ -595,10 +591,7 @@ \section{Restrictions of Connections and Connectors}\label{restrictions-of-conne
For-equations always have parameter expressions for the array expression.
\end{nonnormative}
\item
A connector component shall not be declared with the prefix parameter or
constant. In the connect-equation the primitive components may only
connect parameter variables to parameter variables and constant
variables to constant variables.
A connector component shall not be declared with the prefix \lstinline!parameter! or \lstinline!constant!. In the connect-equation the primitive components may only connect parameter variables to parameter variables and constant variables to constant variables.
\item
The connect-equation construct only accepts forms of connector
references as specified in \cref{connect-equations-and-connectors}.
Expand Down Expand Up @@ -712,14 +705,7 @@ \subsection{Balancing Restriction and Size of Connectors}\label{balancing-restri
end Frame_Illegal;
\end{lstlisting}

The \lstinline!Frame_Illegal! connector (intended to be used in a
simple MultiBody-package without over-determined connectors) is illegal
since the number of flow and non-flow variables do not match. The
solution is to create two connector classes, where two 3-vectors (e.g.,
a and z) are acausal Real and the other variables are matching pairs of
\lstinline!input! and \lstinline!output!. This ensures that the models can only be
connected in a tree-structure or require a ``loop-breaker'' joint for
every closed kinematic loop:
The \lstinline!Frame_Illegal! connector (intended to be used in a simple multi-body package without over-determined connectors) is illegal since the number of flow and non-flow variables do not match. The solution is to create two connector classes, where two 3-vectors (e.g., \lstinline!a! and \lstinline!z!) are acausal \lstinline!Real! and the other variables are matching pairs of \lstinline!input! and \lstinline!output!. This ensures that the models can only be connected in a tree-structure or require a ``loop-breaker'' joint for every closed kinematic loop:
\begin{lstlisting}[language=modelica]
connector Frame_a "correct connector"
input Modelica.Units.SI.Position r0[3];
Expand Down
25 changes: 7 additions & 18 deletions chapters/glossary.tex
Expand Up @@ -234,24 +234,13 @@ \chapter{Glossary}\label{glossary}

\glossaryitem{scalar} or scalar variable: a variable that is not an array.

\glossaryitem{simple type:} Real, Boolean, Integer, String and enumeration
types

\glossaryitem{specialized class}: one of: model, connector, package, record,
block, function, 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 package class restriction
must only contain classes and constants. (See \cref{specialized-classes}.)

\glossaryitem{subtype} or \glossaryitem{interface compatible}: relation between
types. A is a subtype of (interface compatible with) B iff a number of
properties of A and B are the same and all important elements of B have
corresponding elements in A with the same names and their types being
subtypes of the corresponding element types in B. See also restricted
subtyping and function restricted subtyping. (See \cref{interface-compatibility-or-subtyping}.)

\glossaryitem{supertype}: relation between types. The inverse of subtype. A is
a subtype of B means that B is a supertype of A. (See \cref{interface-compatibility-or-subtyping}.)
\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
Expand Down
4 changes: 2 additions & 2 deletions chapters/revisions.tex
Expand Up @@ -115,8 +115,8 @@ \subsection{Main changes in Modelica 3.4}\label{main-changes-in-modelica-3-4}
Clarify inheritance from predefines types, \cref{specialized-classes}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/1250}{\#1250}.
\item
Allow connector inheriting from operator record, \cref{specialized-classes}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/1714}{\#1714}.
Allow \lstinline!connector! inheriting from \lstinline!operator record!, \cref{specialized-classes}.
Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/1714}{\#1714}.
\item
Clarify restrictions on record components, \cref{specialized-classes}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/1615}{\#1615}.
Expand Down
2 changes: 1 addition & 1 deletion chapters/statements.tex
Expand Up @@ -170,7 +170,7 @@ \subsubsection{Assignments from Called Functions with Multiple Results}\label{as
\end{nonnormative}

\subsubsection{Restrictions on assigned variables}\label{restrictions-on-assigned-variables}
Only components of the restricted classes type, record, operator record, and connector may appear as left-hand-side in algorithms.
Only components of the restricted classes \lstinline!type!, \lstinline!record!, \lstinline!operator record!, and \lstinline!connector! may appear as left-hand-side in algorithms.
This applies both to simple assignment statements, and the parenthesized, comma-separated list of variables for functions with multiple results.

\subsection{For-statement}\label{for-statement}
Expand Down

0 comments on commit 185f85a

Please sign in to comment.