fixed subsection format

This commit is contained in:
2024-09-19 05:19:29 +00:00
parent a14d77f075
commit dc876ec98b

View File

@@ -221,7 +221,7 @@ The types and terms of \lambdammm\ are defined in Figure \ref{fig:syntax_v}.
Two terms are introduced in addition to the standard simply-typed lambda calculus: $delay\ n\ e_1\ e_2$, which refers to the previous value of $e_1$ by $e_2$ samples (with a maximum delay of $n$ to limit memory usage to a finite size), and $feed\ x.e$, an abstraction that allows the user to refer to the result of evaluating $e$ from one time unit earlier as $x$ during the evaluation of $e$ itself.
\subsection{Syntactic sugar of the feedback expression in mimium}
\subsection{Syntactic Sugar of the Feedback Expression in \textit{mimium}}
\label{sec:mimium}
The programming language \textit{mimium}, developed by the author, includes a keyword $self$ that can be used in function definitions to refer to the previous return value of the function. An example of a simple one-pole filter function, which mixes the input and the last output signal such that the sum of the input and feedback gains is 1, is shown in Listing \ref{lst:onepole}. This code can be expressed in \lambdammm\ as shown in Figure \ref{fig:onepole}.
@@ -243,7 +243,7 @@ The programming language \textit{mimium}, developed by the author, includes a ke
\caption{\label{fig:onepole}{\it Equivalent expression to Listing \ref{lst:onepole} in $\lambda_{mmm}$.}}
\end{figure}
\subsection{Typing Rule}
\subsection{Typing Rules}
\label{sec:typing}
\input{typing.tex}
@@ -346,7 +346,7 @@ ADDI & A B C & R(A) := R(B) as int + R(C) as int \\
\caption{\label{fig:instruction}{\it Instruction sets for VM to run $\lambda_{mmm}$.}}
\end{figure*}
\subsection{Overview of the VM structure}
\subsection{Overview of the VM Structure}
\label{sec:vmstructure}
The overview of a data structure of the virtual machine, the program and the instantiated closure for \lambdammm\ is shown in Figure \ref{fig:vmstructure}. In addition to the normal call stack, the VM has a storage area for managing internal state data for feedback and delay.
@@ -368,7 +368,7 @@ In the current specification, the paradigm is call-by-value and reassignment exp
\caption{\label{fig:vmstructure}{\it Overview of the virtual machine, program and instantiated closures for \lambdammm.}}
\end{figure*}
\subsection{Compilation to the VM instructions}
\subsection{Compilation to the VM Instructions}
\begin{lstlisting}[float,floatplacement=H,label=lst:bytecodes_onepole,caption=\it Compiled VM instructions of one-pole filter example in Listing \ref{lst:onepole}]
CONSTANTS:[1.0]
@@ -393,7 +393,7 @@ For example, when a time counter is written as \texttt{| | \{self + 1\}}, it is
A more complex example code and its expected bytecode instructions are shown in Listing \ref{lst:fbdelay} and Listing \ref{lst:bytecodes_fbdelay}. The codes define delay with a feedback as \texttt{fbdelay}, the other function \texttt{twodelay} uses two feedback delay with different parameters, and \texttt{dsp} finally uses two \texttt{twodelay} function.
Each after the referring to \texttt{self} through \texttt{GETSTATE} instruction, or call to the other statefull function, \\ \texttt{SHIFTSTATE} instruction inserted to move the position of state storage forward to prepare the next non-closure function call. Before exiting function, the state position is reset to the same position as that the current function context has begun by \texttt{SHIFTSTATE} (A sum of the operand for \texttt{SHIFTSTATE} in a function must be always 0). Figure \ref{fig:fbdelay_spos} shows how the state position moves by \texttt{SHIFTSTATE} operations during the execution of \texttt{twodelay} function.
Each after the referring to \texttt{self} through \texttt{GETSTATE} instruction, or call to the other statefull function, \\ \texttt{SHIFTSTATE} instruction inserted to move the position of state storage forward to prepare the next non-closure function call. Before exiting function, the state position is reset to the same position as that the current function context has begun by \texttt{SHIFTSTATE} (A sum of the operand for \texttt{SHIFTSTATE} in a function must be always 0). Figure \ref{fig:fbdelay_spos} shows how the state position moves by \texttt{SHIFT-}\\\texttt{STATE} operations during the execution of \texttt{twodelay} function.
By describing an internal state as a relative position in the state storage, the state data can be expressed as a flat array, which makes the implementation of the compiler simple, not like a tree structure that need to analyze a call tree from the root to generate as in the previous implementation of mimium. This is similar to upvalue makes the implementation of the compiler simpler by describing free variables as relative positions on the call stack.
@@ -548,7 +548,7 @@ On the other hand, there is the problem that the single semantics causes \lambda
\caption{\label{tab:comparison}{\it Comparison of the way of signal graph generation and actual signal processing between Faust, Kronos and \lambdammm.}}
\end{table}
\subsection{Different behaviour depending on the location of let binding}
\subsection{Different Behaviour Depending on the Location of Let Binding}
\label{sec:letbinding}
By having functions that have internal states which change over time in mimium, when higher-order functions are used, there is a counterintuitive behavior compared to general functional programming languages.
@@ -598,7 +598,7 @@ To solve this situation, introducing distinction whether the term should be used
\texttt{filterbank} function is evaluated in stage 0 while embedding itself by using \texttt{\textasciitilde}. This multi-stage computation code still has a same semantics in a generative signal graph generation and execution of the signal processing, in contrast to that Faust and Kronos.
\subsection{A possibility of the foreign statefull function call}
\subsection{A Possibility of the Foreign Stateful Function Call}
The data structure of closure in \lambdammm\ is a combination of functions and internal states, as shown in Figure 3. The fact that\\ \texttt{filterbank} samples do not require any special handling of internal states also means that external signal processor (Unit Generator: UGen) such as oscillators and filters written in C or C++, for example, can be called from mimium in the same way as normal closure calls, and it is even possible to parametrically duplicate and combine external UGens. This is an advantage that is difficult to implement in Faust and other similar languages, but easy to implement on \lambdammm\ paradigm.