Skip to content

Commit

Permalink
Clean up formatting in "Matching Function"
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Mar 31, 2021
1 parent 44cc953 commit 9fa20d6
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions chapters/overloaded.tex
Expand Up @@ -58,10 +58,7 @@ \section{Overview of overloaded operators}\label{overview-of-overloaded-operator

\section{Matching Function}\label{matching-function}

All functions defined inside the \lstinline!operator! class must return one
output (based on the restriction above), and may include functions with
optional arguments, i.e.\ functions of the form

All functions defined inside the \lstinline!operator! class must return one output (based on the restriction above), and may include functions with optional arguments, i.e.\ functions of the form
\begin{lstlisting}[language=modelica]
function f
input $A_1$ $u_1$;
Expand All @@ -74,17 +71,16 @@ \section{Matching Function}\label{matching-function}
$\ldots$
end f;
\end{lstlisting}
The vector P indicates whether argument m of f has a default value (\lstinline!true! for default value, \lstinline!false! otherwise). A call
f($A_1$, $a_{2}$,\ldots{}, $a_{k}$, $b_{1}$ = $w_{1}$ ,\ldots{}, $b_{p}$ = $w_{p}$)
with distinct names $b_{j}$ is a valid match for the function f, provided (treating \lstinline!Integer! and \lstinline!Real! as the same type)

The vector $P$ indicates whether argument $m$ of \lstinline!f! has a default value (\lstinline!true! for default value, \lstinline!false! otherwise).
A call \lstinline!f($A_1$, $a_{2}$, $\ldots$, $a_{k}$, $b_{1}$ = $w_{1}$, $\ldots$, $b_{p}$ = $w_{p}$)! with distinct names $b_{j}$ is a valid match for the function \lstinline!f!, provided (treating \lstinline!Integer! and \lstinline!Real! as the same type)
\begin{itemize}
\item
$A_{i}$ = typeOf($A_{i}$) for $1 \leq i \leq k$,
\item
the names $b_{j}$ = $u_{\mathit{Qj}}$, $\mathit{Qj} > k$, $A_{\mathit{Qj}}$ = typeOf($w_{i}$) for $1 \leq j \leq p$, and
the names $b_{j}$ = $u_{Q_{j}}$, $Q_{j} > k$, $A_{Q_{j}}$ = typeOf($w_{i}$) for $1 \leq j \leq p$, and
\item
if the union of $\{i: 1 \leq i \leq k \}$, $\{\mathit{Qj}: 1 \leq j \leq p\}$, and $\{m: P_{m} \text{ is \lstinline!true! and } 1 \leq m \leq n \}$ is the set $\{i: 1 \leq i \leq n\}$.
if the union of $\{i: 1 \leq i \leq k \}$, $\{Q_{j}: 1 \leq j \leq p\}$, and $\{m: P_{m} \text{ is \lstinline!true! and } 1 \leq m \leq n \}$ is the set $\{i: 1 \leq i \leq n\}$.
\end{itemize}

\begin{nonnormative}
Expand Down

0 comments on commit 9fa20d6

Please sign in to comment.