-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathmacros.tex
123 lines (93 loc) · 5.01 KB
/
macros.tex
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
% Common notation
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{xspace}
\newcommand{\lectureurl}{https://iccl.inf.tu-dresden.de/web/TheoLog2024}
\DeclareMathAlphabet{\mathsc}{OT1}{cmr}{m}{sc} % Let's have \mathsc since the slide style has no working \textsc
% Dual of "phantom": make a text that is visible but intangible
\newcommand{\ghost}[1]{\raisebox{0pt}[0pt][0pt]{\makebox[0pt][l]{#1}}}
\newcommand{\tuple}[1]{\langle{#1}\rangle}
\newcommand{\defeq}{\mathrel{:=}}
%%% Annotation %%%
\usepackage{color}
\newcommand{\todo}[1]{{\tiny\color{red}\textbf{TODO: #1}}}
\newcommand{\quantor}{\mathord{\reflectbox{$\text{\sf{Q}}$}}} % the generic quantor
\newcommand{\unieq}{\stackrel{.}{=}} % equality sign for unification problems
%%% Old macros below; move when needed
\newcommand{\blank}{\text{\textvisiblespace}} % empty tape cell for TM
% table syntax
\newcommand{\dom}{\textbf{dom}}
\newcommand{\adom}{\textbf{adom}}
\newcommand{\dbconst}[1]{\texttt{"#1"}}
\newcommand{\pred}[1]{\textsf{#1}}
\newcommand{\foquery}[2]{#2[#1]}
\newcommand{\ground}[1]{\textsf{ground}(#1)}
% \newcommand{\foquery}[2]{\{#1\mid #2\}} %% Notation as used in Alice Book
% \newcommand{\foquery}[2]{\tuple{#1\mid #2}}
% logic syntax
\newcommand{\Inter}{\mathcal{I}} %used to denote an interpretation
\newcommand{\Jnter}{\mathcal{J}} %used to denote another interpretation
\newcommand{\Knter}{\mathcal{K}} %used to denote yet another interpretation
\newcommand{\Zuweisung}{\mathcal{Z}} %used to denote a variable assignment
% query languages
\newcommand{\qlang}[1]{{\sf #1}} % Font for query languages
\newcommand{\qmaps}[1]{\textbf{QM}({\sf #1})} % Set of query mappings for a query language
%%% Complexities %%%
\hyphenation{Exp-Time} % prevent "Ex-PTime" (see, e.g. Tobies'01, Glimm'07 ;-)
\hyphenation{NExp-Time} % better that than something else
% \newcommand{\complclass}[1]{{\sc #1}\xspace} % font for complexity classes
\newcommand{\complclass}[1]{\ensuremath{\mathsc{#1}}\xspace} % font for complexity classes
\newcommand{\ACzero}{\complclass{AC$_0$}}
\newcommand{\LogSpace}{\complclass{L}}
\newcommand{\NLogSpace}{\complclass{NL}}
\newcommand{\PTime}{\complclass{P}}
\newcommand{\NP}{\complclass{NP}}
\newcommand{\coNP}{\complclass{coNP}}
\newcommand{\PH}{\complclass{PH}}
\newcommand{\PSpace}{\complclass{PSpace}}
\newcommand{\NPSpace}{\complclass{NPSpace}}
\newcommand{\ExpTime}{\complclass{ExpTime}}
\newcommand{\NExpTime}{\complclass{NExpTime}}
\newcommand{\ExpSpace}{\complclass{ExpSpace}}
\newcommand{\TwoExpTime}{\complclass{2ExpTime}}
\newcommand{\NTwoExpTime}{\complclass{N2ExpTime}}
\newcommand{\ThreeExpTime}{\complclass{3ExpTime}}
\newcommand{\kExpTime}[1]{\complclass{#1ExpTime}}
\newcommand{\kExpSpace}[1]{\complclass{#1ExpSpace}}
%%% Style commands
\newcommand{\quoted}[1]{\texttt{"}{#1}\texttt{"}}
\newcommand{\squote}{\texttt{"}} % straight quote
\newcommand{\Sterm}[1]{\ensuremath{\mathtt{\textcolor{purple}{#1}}}} % letters in alphabets
\newcommand{\Snterm}[1]{\textsf{\textcolor{darkblue}{#1}}} % nonterminal symbols
\newcommand{\Sntermsub}[2]{\ensuremath{\Snterm{#1}_{\Snterm{#2}}}} % nonterminal symbols
\newcommand{\Slang}[1]{\textbf{\textcolor{black}{#1}}} % languages
\newcommand{\Slangsub}[2]{\ensuremath{\Slang{#1}_{\Slang{#2}}}} % languages
% Code
\newcommand{\Scode}[1]{\textbf{#1}} % reserved words in program listings, e.g., "if"
\newcommand{\Scodelit}[1]{\textcolor{purple}{#1}} % literals in program listings, e.g., strings
\newcommand{\Scomment}[1]{\textcolor{gray}{#1}} % comment in program listings
% LOOP and WHILE programs
\newcommand{\Svar}[1]{\texttt{#1}} % variable names
\newcommand{\Svsub}[2]{\ensuremath{\Svar{#1}_{\Svar{#2}}}} % variable names
\newcommand{\Sxsub}[1]{\Svsub{x}{#1}} % variable names
\newcommand{\Sseq}{\texttt{;}}
\newcommand{\SStartLoop}[1]{\Scode{LOOP}~#1~\Scode{DO}~}
\newcommand{\SEndLoop}{\Scode{END}}
\newcommand{\SStartIf}[1]{\Scode{IF}~#1~\Scode{THEN}~}
\newcommand{\SElse}{\Scode{ELSE}}
\newcommand{\SEndIf}{\Scode{END}}
\newcommand{\Svassign}{\texttt{ := }} % variable assignments
\newcommand{\Svneq}{\texttt{!=}\ensuremath{\,}} % inequality operator
\newcommand{\Splus}{\texttt{ + }} % addition operator
\newcommand{\Sminus}{\texttt{ - }} % subtraction operator
\newcommand{\SStartWhile}[1]{\Scode{WHILE}~#1\Svneq\texttt{\Scodelit{0}}~\Scode{DO}~}
\newcommand{\SEndWhile}{\Scode{END}}
\newcommand{\bbfunc}{\boldsymbol{\Sigma}}
\newcommand{\epstrastar}{\mathrel{\mathord{\stackrel{\epsilon}{\to}}{}^*}} % transitive reflexive closure of epsilon transitions in an epslion-NFA
\newcommand{\narrowcentering}[1]{\mbox{}\hfill#1\hfill\mbox{}}
\newcommand{\Smach}[1]{\ensuremath{\mathcal{#1}}} % machines
\newcommand{\mytrue}{\Scodelit{1}}
\newcommand{\myfalse}{\Scodelit{0}}
% \newcommand{\emptyClause}{\bot}
\newcommand{\Scomplclass}[1]{{\textsc{#1}}\xspace} % font for complexity classes, used on slides where the "too many alphabets" LaTeX error appears when using the correct sc font :-(
% \newcommand{\complclass}[1]{\ensuremath{\mathsc{#1}}} % font for complexity classes
\DeclareMathOperator{\enc}{\mathsf{enc}}