Skip to content

Commit

Permalink
Replace lots of \textbf with \lstinline
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Jun 3, 2020
1 parent 5c6e174 commit ecc6111
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 126 deletions.
2 changes: 1 addition & 1 deletion chapters/operatorsandexpressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ \subsubsection{spatialDistribution}\doublelabel{spatialdistribution}
This allows to directly compute the solution based on interpolating the
boundary conditions.

\textbf{spatialDistribution} can be described in terms of the pseudo-code given as a block:
\lstinline!spatialDistribution! can be described in terms of the pseudo-code given as a block:
\begin{lstlisting}[language=modelica]
block spatialDistribution
input Real in0;
Expand Down
30 changes: 15 additions & 15 deletions chapters/statemachines.tex
Original file line number Diff line number Diff line change
Expand Up @@ -50,49 +50,49 @@ \section{Transitions}\doublelabel{transitions}

Any Modelica block instance without continuous-time equations or
algorithms can potentially be a state of a state machine. A cluster of
instances which are coupled by \textbf{transition} statements makes a
instances which are coupled by \lstinline!transition! statements makes a
state machine. All parts of a state machine must have the same clock.
All transitions leaving one state must have different priorities. One
and only one instance in each state machine must be marked as initial by
appearing in an \textbf{initialState} statement. The following special
appearing in an \lstinline!initialState! statement. The following special
kinds of connect-statements are used to define transitions between
states and to define the initial state:
\begin{longtable}[]{|p{4cm}|p{10cm}|}
\hline \endhead
\multicolumn{2}{|p{12cm}|}{\tablehead{Statements to define a state machine}}\\ \hline
\begin{tabular}{@{}p{4cm}@{}}
\textbf{transition}(from, to, \\ condition,\\
\lstinline!transition!(from, to,\\
condition,\\
immediate, reset,\\
synchronize, priority)
\end{tabular}
&
Arguments \lstinline!from! and \lstinline!to! are block instances and \lstinline!condition! is a
\lstinline!Boolean! argument. The optional arguments \lstinline!immediate!, \lstinline!reset!, and
\lstinline!synchronize! are of type \lstinline!Boolean!, have parametric variability and a
default of \textbf{true, true, false} respectively. The optional
default of \lstinline!true!, \lstinline!true!, \lstinline!false! respectively. The optional
argument \lstinline!priority! is of type \lstinline!Integer!, has parametric variability and
a default of 1.

This operator defines a transition from instance \lstinline!from! to instance
\lstinline!to!. The \lstinline!from! and \lstinline!to! instances become states of a state
machine. The transition fires when condition = \textbf{true} if
immediate = \textbf{true} (this is called an \firstuse{immediate transition})
or \textbf{previous}(condition) when immediate = \textbf{false} (this is
machine. The transition fires when \lstinline!condition = true! if
\lstinline!immediate = true! (this is called an \firstuse{immediate transition})
or \lstinline!previous(condition)! when \lstinline!immediate = false! (this is
called a \firstuse{delayed transition}). Argument \lstinline!priority! defines the
priority of firing when several transitions could fire. In this case the
transition with the smallest value of \lstinline!priority! fires. It is required
that $\textrm{priority}\ge 1$ and that for all transitions from the same state, the
priorities are different. If reset = \textbf{true}, the states of the
priorities are different. If \lstinline!reset = true!, the states of the
target state are reinitialized, i.e. state machines are restarted in
initial state and state variables are reset to their start values. If
synchronize=true, any transition is disabled until all state machines of
the from-state have reached final states, i.e. states without outgoing
transitions. For the precise details about firing a transition, see
\autoref{state-machine-semantics}.\\ \hline
\textbf{initialState}(state) & Argument \lstinline!state! is the block instance
\lstinline!initialState(state)! & Argument \lstinline!state! is the block instance
that is defined to be the initial state of a state machine. At the first
clock tick of the state machine, this state becomes
active.\\ \hline
clock tick of the state machine, this state becomes active.\\ \hline
\end{longtable}

The transition-, and initialState-equations may only be used in
Expand All @@ -103,11 +103,11 @@ \section{Transitions}\doublelabel{transitions}
following operators:
\begin{longtable}[]{|p{4cm}|p{10cm}|}
\hline \endhead
\textbf{activeState}(state)&
\lstinline!activeState(state)!&
Argument \lstinline!state! is a block instance. The operator returns
\textbf{true}, if this instance is a state of a state machine and this
\lstinline!true!, if this instance is a state of a state machine and this
state is active at the actual clock tick. If it is not active, the
operator returns \textbf{false}.
operator returns \lstinline!false!.

It is an error if the instance is not a state of a state machine.\\ \hline
\lstinline!ticksInState()! & Returns the number of ticks of the clock of the state machine
Expand Down Expand Up @@ -413,7 +413,7 @@ \subsection{Merging Variable Definitions}\doublelabel{merging-variable-definitio
v := if activeState(state!\textsubscript{1}!) then expre!\textsubscript{1}! elseif activeState(state!\textsubscript{2}!) then expre!\textsubscript{2}! elseif ... else last(v)
\end{lstlisting}

\textbf{last}() is special internal semantic operator returning its
\lstinline!last! is special internal semantic operator returning its
input. It is just used to mark for the sorting that the incidence of its
argument should be ignored. A start value must be given to the variable
if not assigned in the initial state.
Expand Down
Loading

0 comments on commit ecc6111

Please sign in to comment.