File: commands.tex

package info (click to toggle)
theme-d 6.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 19,720 kB
  • sloc: lisp: 8,701; sh: 4,588; makefile: 617; ansic: 477
file content (232 lines) | stat: -rw-r--r-- 10,124 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
%% Copyright (C) 2016-2019 Tommi Höynälänmaa

\newcommand{\theme}{Theme-D}
\newcommand{\defterm}[1]{\textit{#1}}
\newcommand{\code}[1]{\texttt{#1}}
\newcommand{\myurl}[1]{#1}
\newcommand{\inhsymb}{\(:<\)}
\newcommand{\minhsymb}{:<}
\newcommand{\inherits}[2]{{#1} \inhsymb\ {#2}}
\newcommand{\imminhsymb}{\(::<\)}
\newcommand{\mimminhsymb}{::<}
\newcommand{\imminh}[2]{{#1} \imminhsymb\ {#2}}
%%\newcommand{\keyword}[1]{{\ttfamily{}{\bfseries{}{#1}}}}
\newcommand{\keyword}[1]{\textrm{\bfseries{}{#1}}}
\newcommand{\ckeyword}[1]{\textrm{\bfseries{}{#1}}}
\newcommand{\skeyword}[1]{\textrm{\bfseries{}{#1}}}
\newcommand{\macro}[1]{\textrm{\bfseries{}{#1}}}
\newcommand{\builtin}[1]{\code{#1}}
\newcommand{\cbuiltin}[1]{\code{#1}}
\newcommand{\obuiltin}[1]{\code{#1}}
\newcommand{\sbuiltin}[1]{\code{#1}}
\newcommand{\mbuiltin}[1]{\code{#1}}
\newcommand{\typeparam}[1]{{\%{#1}}}
\newcommand{\sldots}{...}
\newcommand{\oldots}{...}
\newcommand{\nan}{NaN}
\newcommand{\myln}{\ln}

\newcommand{\syntaxmath}[1]{\({#1}\)}
\newcommand{\syntaxdefequal}{\(::=\)}
\newcommand{\syntaxelement}[1]{\textrm{#1}}
\newcommand{\syntaxor}{\(\vert\)\ }
\newcommand{\syntaxopt}[1]{{[}{#1}{]}}
\newcommand{\syntaxvar}[1]{{\rmfamily{}\textit{#1}}}
\newcommand{\indexedsyntaxvar}[2]{{\rmfamily{}\(\textit{#1}_{#2}\)}}
\newenvironment{syntaxblock}%
{\par\vspace{0.5cm}\noindent}%
{\vspace{0.5cm}\par\noindent}
\newenvironment{syntaxformula}{}{}
\newcommand{\syntaxformulacmd}[1]{#1}
\newcommand{\syntaxvarf}[1]{\syntaxformulacmd{\syntaxvar{#1}}}
\newcommand{\indexedsyntaxvarf}[2]{\syntaxformulacmd{\indexedsyntaxvar{#1}{#2}}}
\newcommand{\syntaxspace}{\ }
\newcommand{\syntaxelementf}[1]{\syntaxformulacmd{\syntaxelement{#1}}}

\newcommand{\objectvar}[1]{{\rmfamily{}\textit{#1}}}
\newcommand{\mobjectvar}[1]{{\textit{#1}}}
\newcommand{\indexedobjectvar}[2]{{\rmfamily{}\(\textit{#1}_{#2}\)}}
\newcommand{\indexedmobjectvar}[2]{{\mathit{#1}_{#2}}}
\newenvironment{objectblock}%
{\par\vspace{0.5cm}\noindent}%
{\vspace{0.5cm}\par\noindent}
\newenvironment{objectformula}{}{}
\newcommand{\objectformulacmd}[1]{#1}
\newcommand{\objectvarf}[1]{\objectformulacmd{\objectvar{#1}}}
\newcommand{\indexedobjectvarf}[2]{\objectformulacmd{\indexedobjectvar{#1}{#2}}}
\newcommand{\objectspace}{\ }

\newcommand{\tupletype}{:tuple}
\newenvironment{arglist}{\noindent}{}
\newcommand{\procarg}[1]{\code{#1}}
\newcommand{\proctypearg}[1]{\(\textrm{\syntaxvar{#1}}\)}
%% syntax parentheses
\newcommand{\slp}{\texttt{(}}
\newcommand{\srp}{\texttt{)}}
%% list parentheses in math mode
\newcommand{\mlistlp}{\texttt{(}}
\newcommand{\mlistrp}{\texttt{)}}
%% metaparentheses
\newcommand{\mlp}{\textrm{\{}}
\newcommand{\mrp}{\textrm{\}}}
\newcommand{\olp}{\texttt{(}}
\newcommand{\orp}{\texttt{)}}
\newcommand{\indexedprocarg}[2]{\code{{#1}-{#2}}}
\newcommand{\indexedproctypearg}[2]{\({\textrm{\syntaxvar{#1}}}_{#2}\)}
\newcommand{\argument}[3]{\newline \mbox{ }\hspace{0.5cm} Name: %
  \procarg{#1}\newline \mbox{ }\hspace{0.5cm} Type: {#2}\newline %
  \mbox{ }\hspace{0.5cm} Description: {#3}\newline}
\newcommand{\shortargument}[2]{\newline %
  \mbox{ }\hspace{0.5cm} \procarg{#1} : {#2}}
\newcommand{\argumentnodesc}[2]{\newline \mbox{ }\hspace{0.5cm} Name: %
  \procarg{#1}\newline \mbox{ }\hspace{0.5cm} Type: {#2}\newline}
\newcommand{\indexedargument}[4]{\newline \mbox{ }\hspace{0.5cm} Name: %
  \indexedprocarg{#1}{#2}\newline \mbox{ }\hspace{0.5cm} Type: {#3}\newline %
  \mbox{ }\hspace{0.5cm} Description: {#4}\newline}
\newcommand{\typeargument}[3]{\newline \mbox{ }\hspace{0.5cm} Name: %
  \proctypearg{#1}\newline \mbox{ }\hspace{0.5cm} Type: {#2}\newline %
  \mbox{ }\hspace{0.5cm} Description: {#3}\newline}
\newcommand{\indexedtypeargument}[4]{\newline \mbox{ }\hspace{0.5cm} Name: %
  \indexedproctypearg{#1}{#2}\newline \mbox{ }\hspace{0.5cm} Type: {#3}\newline %
  \mbox{ }\hspace{0.5cm} Description: {#4}\newline}
\newcommand{\procresult}[2]{\noindent \textit{Result value}: %
  {#1}\newline %
  \textit{Result type:} %
  {#2}\newline}
\newcommand{\noprocresult}{\par\noindent{}No result value.\newline}
\newcommand{\startprocsyntax}{\noindent\textit{Syntax:}}
\newcommand{\startprocarguments}{\noindent{}\textit{Arguments:}\newline}
\newcommand{\shortprocarguments}{\noindent{}\textit{Arguments:}\newline}
\newcommand{\shortprocdesc}{\mbox{ }\hspace{0.3cm}\noindent{}}
\newcommand{\noprocarguments}{\par\noindent{}No arguments.\newline}
\newcommand{\typeparams}[1]{\par\noindent{}\textit{Type parameters:} %
  {\ttfamily{#1}}\vspace{0.5cm}}
\newcommand{\procpurity}[1]{\par\noindent{}\textit{Purity of the %
    procedure: }{#1}\vspace{0.5cm}}
\newcommand{\startmacrosyntax}{\noindent\textit{Syntax:}}
\newcommand{\precondition}[1]{\par\noindent{}\textit{Precondition: }%
  {#1}\vspace{0.5cm}}
% \newcommand{\cindtop}{\hspace{1cm}}
% \newcommand{\cind}{\hspace{0.5cm}}
\newcommand{\cindtop}{\;\;\;\;}
\newcommand{\cind}{\;\;}
\newcommand{\algorithmname}[1]{\textsf{#1}}
\newcommand{\algappllparen}{[}
\newcommand{\algapplrparen}{]}
\newcommand{\alglistlparen}{(}
\newcommand{\alglistrparen}{)}
\newcommand{\algapplylparen}{(}
\newcommand{\algapplyrparen}{)}
\newcommand{\algorithmappl}[2]{\algorithmname{#1}\algappllparen{}{#2}\algapplrparen}
% \newenvironment{codeblock}%
% {\vspace{0.5cm}\hspace{0.5cm}\noindent}%
% {\vspace{0.5cm}}
\newenvironment{codeblock}%
{\par\vspace{0.5cm}\ttfamily}%
{\mbox{ }\vspace{0.5cm}\newline}
% \newenvironment{codeblock}{\begin{verbatim}}{\end{verbatim}}
\newenvironment{codeformula}{\ttfamily}{}
\newcommand{\codeformulacmd}[1]{{\ttfamily{}#1}}

\newcommand{\indexedprocargf}[2]{\syntaxformulacmd{\indexedprocarg{#1}{#2}}}
\newenvironment{arglistdeclcode}%
{\par\noindent{}\textit{Argument list declaration:}\begin{codeblock}}%
{\end{codeblock}}
\newenvironment{resultdeclcode}%
{\par\noindent{}\textit{Result type declaration:}\begin{codeblock}}%
{\end{codeblock}}
\newenvironment{datatype}{\par\noindent}{}
\newcommand{\datatypename}[1]{\par\noindent\textit{Data type name: }{\code{#1}}%
\index{\code{#1}}}
\newcommand{\datatypetype}[1]{\par\noindent\textit{Type: }{#1}}
\newcommand{\datatypenrparams}[1]{\par\noindent\textit{Number of type %
    parameters: }{#1}}
\newcommand{\datatypedesc}[1]{\par\noindent\textit{Description: }{#1}}
\newcommand{\datatypedef}[1]{\par\noindent\textit{Definition: }{\code{#1}}}
%% \newcommand{\setvarsym}{\(\leftarrow\)}
\newcommand{\setvarsym}{:=}
\newcommand{\setvar}[2]{{#1} \setvarsym\ {#2}}
\newcommand{\algdefequal}{\setvarsym}
\newcommand{\snot}{\(\lnot\)}
\newcommand{\setsep}{:}
\newcommand{\sta}{\indexedobjectvarf{t}{1}}
\newcommand{\stb}{\indexedobjectvarf{t}{2}}
\newcommand{\true}{\code{\#t}}
\newcommand{\false}{\code{\#f}}
\newcommand{\algresult}{Result:}
\newcommand{\algarguments}{Arguments:}
\newcommand{\noalgresult}{\par\noindent{}\textit{No result value.}\newline}
\newenvironment{ifblock}{}{}
\newcommand{\truewithmp}{\(\mlistlp \true\ M' \mlistrp\)}
\newcommand{\falsewithmp}{\(\mlistlp \false\ M' \mlistrp\)}
\newcommand{\truewithm}{\(\mlistlp \true\ M \mlistrp\)}
\newcommand{\falsewithm}{\(\mlistlp \false\ M \mlistrp\)}
\newcommand{\objectvartp}{\(t'\)}
\newcommand{\objectvarup}{\(u'\)}
\newcommand{\objectvarcapmp}{\(M'\)}
\newcommand{\vprime}{\(v'\)}
\newcommand{\attrlistdef}%
  {\syntaxvar{attribute-list} \syntaxdefequal \slp%
  \syntaxvar{attribute} ... \srp \syntaxor \syntaxvar{attribute} \\%
  \syntaxvar{attribute} \syntaxdefequal%
  \code{pure} \syntaxor \code{nonpure} \syntaxor \code{force-pure} \\%
  \indent%
  \syntaxor \code{always-returns} \syntaxor \code{may-return}%
  \syntaxor \code{never-returns}}
\newcommand{\attrlistdefb}%
  {\syntaxvar{attribute-list} \syntaxdefequal \slp%
  \syntaxvar{attribute} ... \srp \\%
  \syntaxvar{attribute} \syntaxdefequal%
  \code{pure} \syntaxor \code{nonpure} \\%
  \indent%
  \syntaxor \code{always-returns} \syntaxor \code{may-return}%
  \syntaxor \code{never-returns}}
\newcommand{\cl}[1]{\noindent\mbox{ }\hspace{#1}}
\newcommand{\bl}{\(\backslash\)}
\newcommand{\condarrow}{\(=>\)}
\newcommand{\macrodef}[1]{\vspace{1cm}\noindent{\Large{\macro{#1}}}%
  \vspace{0.5cm}\index{\macro{#1}}}
\newcommand{\macrodefa}[1]{\noindent{\Large{\macro{#1}}}%
  \index{\macro{#1}}\newline}
\newcommand{\procdef}[1]{\vspace{1cm}\noindent{\Large{\code{#1}}}%
  \vspace{0.5cm}\index{\code{#1}}}
\newcommand{\procdefexcl}[2]{\vspace{1cm}\noindent{\Large{\code{#1}}}%
  \vspace{0.5cm}\index{\code{#2}}}
\newcommand{\procdefa}[1]{\noindent{\Large{\code{#1}}}%
  \index{\code{#1}}\newline}
\newcommand{\procdefexcla}[2]{\noindent{\Large{\code{#1}}}%
  \index{\code{#2}}\newline}
\newcommand{\puremethoddefwithvalue}[4]{\code{#1}: \code{(#2)} %
  \(\to\) \code{#3} pure %
  \hspace{1em} = \hspace{1em} \code{#4}\newline}
\newcommand{\puremethoddefwithincl}[4]{\code{#1}: \code{(#2)} %
  \(\to\) \code{#3} pure %
  \hspace{1em} (\code{#4}) \newline}
\newcommand{\methoddefwithvalue}[4]{\code{#1}: \code{(#2)} %
  \(\to\) \code{#3} %
  \hspace{1em} = \hspace{1em} \code{#4}\newline}
\newcommand{\methoddefwithincl}[4]{\code{#1}: \code{(#2)} %
  \(\to\) \code{#3} %
  \hspace{1em} (\code{#4}) \newline}
\newcommand{\puremethoddef}[3]{\code{#1}: \code{(#2)} \(\to\) \code{#3} pure%
  \newline}
\newcommand{\methoddef}[3]{\code{#1}: \code{(#2)} %
  \(\to\) \code{#3} \newline}
\newcommand{\abstpuremethoddef}[3]{\code{#1}: \code{(#2)} \(\to\) \code{#3}%
  \hspace{1em} pure abstract\newline}
\newcommand{\abstmethoddef}[3]{\code{#1}: \code{(#2)} \(\to\) \code{#3}%
  \hspace{1em} abstract\newline}
\newcommand{\staticpuremethoddef}[3]{\code{#1}: \code{(#2)} \(\to\) \code{#3}%
  \hspace{1em} static pure\newline}
\newcommand{\indexmethod}[1]{\index{\code{#1}}}
\newcommand{\shortpureprocdef}[3]{\code{#1}: \code{(#2)} \(\to\) \code{#3} pure%
  \index{\code{#1}} \newline}
\newcommand{\shortprocdef}[3]{\code{#1}: \code{(#2)} \(\to\) \code{#3}%
  \newline}
\newcommand{\normalpuremethoddef}[3]{\code{#1}: \code{(#2)} \(\to\) \code{#3} pure%
  \newline}
\newcommand{\normalmethoddef}[3]{\code{#1}: \code{(#2)} %
  \(\to\) \code{#3} \newline}

\DeclareMathOperator{\erf}{erf}
\DeclareMathOperator{\erfc}{erfc}