1 \documentclass[a4paper,
9pt
]{extarticle
}
16 \usepackage[dvipdfm,colorlinks,linkcolor=blue,
17 urlcolor=blue,bookmarks
]{hyperref
}
18 \DeclareFontShape{OT1
}{cmtt
}{bx
}{n
}{<->cmbtt10
}{}
20 \setlength\voffset{-
0.5in
}
21 \addtolength\textheight{1.5in
}
22 \setlength\oddsidemargin{0in
}
23 %\setlength\marginparwidth{1.25in}
24 \setlength\marginparwidth{1.0in
}
25 \setlength\textwidth{\paperwidth}
26 %\addtolength\textwidth{-1.25in}
27 \addtolength\textwidth{-
1.0in
}
28 \addtolength\textwidth{-
\oddsidemargin}
29 \addtolength\textwidth{-
\marginparsep}
30 \addtolength\textwidth{-
\marginparwidth}
33 \setlength\parskip{6pt
}
34 \setlength\parindent{0pt
}
38 \fancyhead[LE,OR
]{\bfseries\thepage}
39 \fancyhead[RE
]{\bfseries\leftmark}
40 \fancyhead[OL
]{\bfseries\rightmark}
41 %\fancyfoot[EC,OC]{\copyright BBC \today}
42 \renewcommand{\headrulewidth}{0.5pt
}
43 \renewcommand{\footrulewidth}{0.5pt
}
44 \addtolength{\headheight}{0.5pt
}
45 \addtolength{\textheight}{-
0.5pt
}
46 \fancypagestyle{plain
}{% no headers on plain pages
48 \renewcommand{\headrulewidth}{0pt
}%
51 %\bibliographystyle{IEEEtran}
52 %\renewcommand\bibname{References}
54 \DeclareMathOperator{\intlog2}{intlog_2
}
55 \DeclareMathOperator{\clip}{clip
}
56 \DeclareMathOperator{\sign}{sign
}
57 \DeclareMathOperator{\row}{row
}
58 \DeclareMathOperator{\rounddivide}{round
\_divide}
59 \DeclareMathOperator{\column}{column
}
60 \DeclareMathOperator{\width}{width
}
61 \DeclareMathOperator{\height}{height
}
62 \DeclareMathOperator{\length}{length
}
63 \DeclareMathOperator{\median}{median
}
64 \DeclareMathOperator{\mean}{mean
}
65 \DeclareMathOperator{\majority}{majority
}
66 \DeclareMathOperator{\args}{args
}
68 \definecolor{shadecolor
}{gray
}{0.90}
69 \newenvironment{informative
}[0]%
72 \FrameCommand{{\bf Note:
}}
76 \newenvironment{informative*
}[0]%
84 \setcounter{secnumdepth
}{4}
85 \setcounter{tocdepth}{4}
86 \definecolor{commentcolour
}{rgb
}{1,
0,
0}
88 \counterwithin{table
}{section
}
89 \counterwithin{figure
}{section
}
94 \newcommand{\MajorVersion}{\text{2}}
95 \newcommand{\MinorVersion}{\text{2}}
96 \newcommand{\TypoVersion}{\text{3-unofficial
}}
97 \newcommand{\SpecVersion}{\text{\MajorVersion.
\MinorVersion.
\TypoVersion}}
100 {\Huge Dirac Specification\\
}
101 {\huge Version
\SpecVersion \\
}
102 {\huge Issued:
\today} }
110 \clearpage { \thispagestyle{empty
}
119 \newcommand{\annotate}[2]{\marginpar{\color{commentcolour
} #2 {\bf ---
#1}}}
123 \setlength{\indentx}{1em
}
125 % Environment for pseudocode with a function declaration %
126 \newenvironment{pseudo
}[2]
127 {\newcommand{\dfindent}{\\
\hline\hspace{\value{indent
}\indentx}}
128 \newcommand{\bsIF}[1]{\dfindent\text{{\bf if
} (
\text{$#
#1$
}):
}\stepcounter{indent
} & &
}
129 \newcommand{\bsEND}{\addtocounter{indent
}{-
1}}
130 \newcommand{\bsELSE}{\addtocounter{indent
}{-
1}\dfindent\text{{\bf else
}:
}\stepcounter{indent
} & &
}
131 \newcommand{\bsELSEIF}[1]{\addtocounter{indent
}{-
1}\dfindent\text{{\bf else if
} (
\text{$#
#1$
}):
}\stepcounter{indent
} & &
}
132 \newcommand{\bsWHILE}[1]{\dfindent\text{{\bf while
} (
\text{$#
#1$
}):
}\stepcounter{indent
} & &
}
133 \newcommand{\bsFOREACH}[2]{\dfindent\text{{\bf for each
} \text{$#
#1$
} {\bf in
} \text{$#
#2$
}:
}\stepcounter{indent
} & &
}
134 \newcommand{\bsFORSUCH}[2]{\dfindent\text{{\bf for
} \text{$#
#1$
} {\bf such that
} \text{$#
#2$
}:
}\stepcounter{indent
} & &
}
135 \newcommand{\bsFOR}[2]{\dfindent\text{{\bf for
} \text{$#
#1$
} {\bf to
} \text{$#
#2$
}:
}\stepcounter{indent
} & &
}
136 % \newcommand{\bsRET}[1]{\dfindent\text{return \text{$##1$}}\addtocounter{indent}{-1} & &}
137 \newcommand{\bsRET}[1]{\dfindent\text{{\bf return
} \text{$#
#1$
}} & &
}
138 \newcommand{\bsCODE}[1]{\dfindent\text{$#
#1$
} & &
}
139 \newcommand{\bsITEM}[3]{\dfindent\text{$#
#1 = read
\_#
#2()$
} & & #
#3}
140 \setcounter{indent
}{1}
142 \begin{tabular
}{|m
{5in
}m
{0.0in
}|m
{0.6in
}|
}
143 % firstline is function definition
145 \text{\cellcolor[gray
]{0.75}$
#1(
#2)$
} : &
\cellcolor[gray
]{0.75} &
146 {\cellcolor[gray
]{0.75}\textbf{Ref
}}
148 { % last line is end of function
153 % Environment for pseudocode without a function declaration %
154 %\newenvironment{pseudo*}[0]
155 % {\newcommand{\dfindent}{\\\hline\hspace{\value{indent}\indentx}}
156 % \newcommand{\bsIF}[1]{\dfindent\text{if (\text{$##1$}):}\stepcounter{indent} & &}
157 % \newcommand{\bsEND}{\addtocounter{indent}{-1}}
158 % \newcommand{\bsELSE}{\addtocounter{indent}{-1}\dfindent\text{else:}\stepcounter{indent} & &}
159 % \newcommand{\bsELSEIF}[1]{\addtocounter{indent}{-1}\dfindent\text{else if (\text{$##1$}):}\stepcounter{indent} & &}
160 % \newcommand{\bsWHILE}[1]{\dfindent\text{while (\text{$##1$}):}\stepcounter{indent} & &}
161 % \newcommand{\bsFOREACH}[2]{\dfindent\text{for each \text{$##1$} in \text{$##2$}:}\stepcounter{indent} & &}
162 % \newcommand{\bsFORSUCH}[2]{\dfindent\text{for \text{$##1$} such that \text{$##2$}:}\stepcounter{indent} & &}
163 % \newcommand{\bsFOR}[2]{\dfindent\text{for \text{$##1$} to \text{$##2$}:}\stepcounter{indent} & &}
164 %% \newcommand{\bsRET}[1]{\dfindent\text{return \text{$##1$}}\addtocounter{indent}{-1} & &}
165 % \newcommand{\bsRET}[1]{\dfindent\text{return \text{$##1$}} & &}
166 % \newcommand{\bsCODE}[1]{\dfindent\text{$##1$} & &}
167 % \newcommand{\bsITEM}[3]{\dfindent\text{$##1 = read\_##2()$} & & ##3}
168 % \setcounter{indent}{1}
170 % \begin{tabular}{|m{4.2in}m{0.0in}|m{0.4in}|}
175 % { % last line is end of function part
180 \newenvironment{pseudo*
}[0]
181 {\newcommand{\dfindent}{\\
\hline\hspace{\value{indent
}\indentx}}
182 \newcommand{\bsIF}[1]{\dfindent\text{{\bf if
} (
\text{$#
#1$
}):
}\stepcounter{indent
} & &
}
183 \newcommand{\bsEND}{\addtocounter{indent
}{-
1}}
184 \newcommand{\bsELSE}{\addtocounter{indent
}{-
1}\dfindent\text{{\bf else
}:
}\stepcounter{indent
} & &
}
185 \newcommand{\bsELSEIF}[1]{\addtocounter{indent
}{-
1}\dfindent\text{{\bf else if
} (
\text{$#
#1$
}):
}\stepcounter{indent
} & &
}
186 \newcommand{\bsWHILE}[1]{\dfindent\text{{\bf while
} (
\text{$#
#1$
}):
}\stepcounter{indent
} & &
}
187 \newcommand{\bsFOREACH}[2]{\dfindent\text{{\bf for each
} \text{$#
#1$
} {\bf in
} \text{$#
#2$
}:
}\stepcounter{indent
} & &
}
188 \newcommand{\bsFORSUCH}[2]{\dfindent\text{{\bf for
} \text{$#
#1$
} {\bf such that
} \text{$#
#2$
}:
}\stepcounter{indent
} & &
}
189 \newcommand{\bsFOR}[2]{\dfindent\text{{\bf for
} \text{$#
#1$
} {\bf to
} \text{$#
#2$
}:
}\stepcounter{indent
} & &
}
190 % \newcommand{\bsRET}[1]{\dfindent\text{return \text{$##1$}}\addtocounter{indent}{-1} & &}
191 \newcommand{\bsRET}[1]{\dfindent\text{{\bf return
} \text{$#
#1$
}} & &
}
192 \newcommand{\bsCODE}[1]{\dfindent\text{$#
#1$
} & &
}
193 \newcommand{\bsITEM}[3]{\dfindent\text{$#
#1 = read
\_#
#2()$
} & & #
#3}
194 \setcounter{indent
}{1}
196 \begin{tabular
}{|m
{5in
}m
{0.0in
}|m
{0.6in
}|
}
201 { % last line is end of function part
205 \tableofcontents \clearpage
206 \input{spec-structure
}