You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

265 lines
7.2 KiB

4 months ago
4 months ago
  1. %\input{util/ltl_macros}
  2. \newcommand{\dom}{\ensuremath\mathcal{A}}
  3. \newcommand{\boolDom}{\ensuremath\mathbb{B}}
  4. \newcommand{\N}{\ensuremath\mathbb{N}}
  5. %\newcommand{\Z}{\ensuremath\mathbb{Z}}
  6. \newcommand{\Q}{\ensuremath\mathbb{Q}}
  7. \newcommand{\R}{\ensuremath\mathbb{R}}
  8. \renewcommand{\phi}{\varphi}
  9. \renewcommand{\implies}{\rightarrow}
  10. \newcommand{\imp}{\rightarrow}
  11. \newcommand{\entails}{\enspace \vdash \enspace}
  12. %\newcommand{\model}{\enspace \vDash \enspace}
  13. \newcommand{\ent}{\enspace \vdash \enspace}
  14. \newcommand{\nmodel}{\enspace \nvDash \enspace}
  15. \newcommand{\nent}{\enspace \nvdash \enspace}
  16. \newcommand{\eqv}{\leftrightarrow}
  17. \newcommand{\biimp}{\leftrightarrow}
  18. \newcommand{\lxor}{\oplus}
  19. \newcommand{\nentails}{\nvdash}
  20. \newcommand{\nmodels}{\nvDash}
  21. \newcommand{\Model}{\ensuremath{\mathcal{M}}}
  22. \newcommand{\impi}{\ensuremath{\imp_i}}
  23. \newcommand{\impe}{\ensuremath{\imp_e}}
  24. \newcommand{\andi}{\ensuremath{\land_i}}
  25. \newcommand{\ande}{\ensuremath{\land_e}}
  26. \newcommand{\ori}{\ensuremath{\lor_i}}
  27. \newcommand{\ore}{\ensuremath{\lor_e}}
  28. \newcommand{\negi}{\ensuremath{\neg_i}}
  29. \newcommand{\nege}{\ensuremath{\neg_e}}
  30. \newcommand{\bote}{\ensuremath{\bot_e}\xspace}
  31. \newcommand{\negnege}{\ensuremath{\neg\neg_e}\xspace}
  32. \newcommand{\negnegi}{\ensuremath{\neg\neg_i}\xspace}
  33. \newcommand{\foralli}{\ensuremath{\forall_i}\xspace}
  34. \newcommand{\foralle}{\ensuremath{\forall_e}\xspace}
  35. \newcommand{\existi}{\ensuremath{\exists_i}\xspace}
  36. \newcommand{\existe}{\ensuremath{\exists_e}\xspace}
  37. \newcommand{\prem}{\text{\scriptsize premise}} %% \prem = premise
  38. \newcommand{\assum}{\text{\scriptsize assumption}} %% \assum = assumption
  39. \newcommand{\freshVar}[1]{\text{\scriptsize fresh~{#1}}}
  40. \newcommand{\MT}{\text{MT}~}
  41. \newcommand{\PBC}{\text{PBC}~}
  42. \newcommand{\LEM}{\text{LEM}}
  43. \newcommand{\copying}{\text{\scriptsize copy}~}
  44. \newcommand{\true}{\ensuremath{\top}}
  45. \newcommand{\false}{\ensuremath{\bot}}
  46. \newcommand{\F}{\textbf{F}}
  47. \newcommand{\T}{\textbf{T}}
  48. \newcommand{\variableOrder}[1]{
  49. \foreach\variable in {#1}
  50. {\ensuremath{~\variable<}}%% FIXME
  51. }
  52. % multiple choice itemize
  53. \newcommand{\ticked}{\ensuremath{\boxtimes}}
  54. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  55. % TSEITIN rules
  56. \newcommand{\tseitinOr}[3]{
  57. \def\CHI{#1}%
  58. \def\PHI{#2}%
  59. \def\PSI{#3}%
  60. \ensuremath{(\lnot \PHI \lor \CHI) \land (\lnot \PSI \lor \CHI) \land (\lnot \CHI \lor \PHI \lor \PSI)}%
  61. }
  62. \newcommand{\tseitinAnd}[3]{
  63. \def\CHI{#1}%
  64. \def\PHI{#2}%
  65. \def\PSI{#3}%
  66. \ensuremath{(\lnot \CHI \lor \PHI) \land (\lnot \CHI \lor \PSI) \land (\lnot \PHI \lor \lnot \PSI \lor \CHI)}%
  67. }
  68. \newcommand{\tseitinNot}[2]{
  69. \def\CHI{#1}%
  70. \def\PHI{#2}%
  71. \ensuremath{(\lnot \CHI \lor \lnot \PHI) \land (\CHI \lor \PHI)}%
  72. }
  73. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  74. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  75. % DPLL helper
  76. \newenvironment{dpllCNFInput}%
  77. {\begin{enumerate}[leftmargin=2.0em,itemindent=2.45em,label=Clause {\arabic*}:]}%
  78. {\end{enumerate}}%
  79. \newenvironment{dplltabular}[1]
  80. {\begin{tabular}{ |l|*{#1}{c|} } \hline}
  81. {\end{tabular}}
  82. \ExplSyntaxOn
  83. \NewDocumentCommand{\dpllrow}{m}
  84. {
  85. \seq_set_split:Nnn \l_row {|} { #1 }
  86. \seq_use:Nn \l_row { & }
  87. \\
  88. \hline
  89. }
  90. \seq_new:N \l_row % allocate a sequence
  91. \ExplSyntaxOff
  92. \newcommand{\dpllStep}[1]{
  93. Step & \dpllrow{#1}
  94. }
  95. \newcommand{\dpllDecL}[1]{
  96. Decision Level & \dpllrow{#1}
  97. }
  98. \newcommand{\dpllAssi}[1]{
  99. Assignment & \dpllrow{#1}
  100. }
  101. \newcommand{\dpllBCP}[1]{
  102. BCP & \dpllrow{#1}
  103. }
  104. \newcommand{\dpllPL}[1]{
  105. PL & \dpllrow{#1}
  106. }
  107. \newcommand{\dpllDeci}[1]{
  108. Decision & \dpllrow{#1}
  109. }
  110. \newcommand{\dpllClause}[3]{
  111. \def\ITEM{#1}%
  112. \def\CLAUSE{#2}%
  113. Cl. \ITEM: \CLAUSE & \dpllrow{#3}
  114. }
  115. \ExplSyntaxOn
  116. \NewDocumentCommand{\clause}{m}
  117. {
  118. \seq_set_split:Nnn \l_clause {;} { #1 }
  119. \seq_use:Nn \l_clause { \lor }
  120. }
  121. \seq_new:N \l_clause % allocate a sequence
  122. \ExplSyntaxOff
  123. \ExplSyntaxOn
  124. \NewDocumentCommand{\cube}{m}
  125. {
  126. \seq_set_split:Nnn \l_cube {;} { #1 }
  127. \seq_use:Nn \l_cube { \land }
  128. }
  129. \seq_new:N \l_cube % allocate a sequence
  130. \ExplSyntaxOff
  131. \newcommand{\cmark}{\ding{51}}
  132. \newcommand{\xmark}{\ding{55}}
  133. \newcommand{\done}{\cmark}
  134. \newcommand{\conflict}{\{\} \xmark}
  135. \NewEnviron{conflictgraph}[1][1.5cm]{%
  136. \begin{tikzpicture}[->,
  137. >=stealth',
  138. shorten >=1pt,
  139. auto,
  140. node distance=#1,
  141. thick,
  142. base node/.style={circle,draw,minimum size=20pt},
  143. real node/.style={double,circle,draw,minimum size=20pt}]
  144. \BODY
  145. \end{tikzpicture}
  146. }
  147. \newcommand*\circled[1]{\tikz[baseline=(char.base)]{
  148. \node[shape=circle,draw,inner sep=1.5pt] (char) {#1};}}
  149. \tikzset{
  150. line/.style={-},
  151. dot/.style={decoration={
  152. markings,
  153. mark=at position #1 with {\draw circle (2pt);}},postaction={decorate}},
  154. fulldot/.style={decoration={
  155. markings,
  156. mark=at position #1 with {\fill circle (2pt);}},postaction={decorate}},
  157. }
  158. \newenvironment{scprooftree}[1]%
  159. {\gdef\scalefactor{#1}\begin{center}\proofSkipAmount \leavevmode}%
  160. {\scalebox{\scalefactor}{\DisplayProof}\proofSkipAmount \end{center} }
  161. \tikzset{
  162. line/.style={-},
  163. dot/.style={decoration={
  164. markings,
  165. mark=at position #1 with {\draw circle (2pt);}},postaction={decorate}},
  166. fulldot/.style={decoration={
  167. markings,
  168. mark=at position #1 with {\fill circle (2pt);}},postaction={decorate}},
  169. }
  170. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  171. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  172. % BDD helper
  173. \newenvironment{cofactors}
  174. {\begin{tabbing}}
  175. {\end{tabbing}}
  176. \NewEnviron{bdd}[1][3em]{%
  177. \begin{tikzpicture}[node distance=#1,
  178. base node/.style={circle,draw,minimum size=20pt},
  179. func node/.style={rectangle,draw,minimum size=10pt},
  180. cofactor/.style={circle,draw,minimum size=10pt},
  181. phantom/.style={circle,draw,inner sep=0pt,minimum size=0pt}]
  182. \BODY
  183. \end{tikzpicture}
  184. }
  185. \newcommand{\funcEdge}[3][]{
  186. \path[] (#2) edge [#1] (#3);
  187. }
  188. \newcommand{\thenEdge}[3][]{
  189. \path[] (#2) edge [#1] (#3);
  190. }
  191. \newcommand{\elseEdge}[3][]{
  192. \path[] (#2) edge [#1] node [midway,draw,circle,fill=white,transform shape,inner sep=0pt,minimum size=0.3em] (ref) {} (#3);
  193. }
  194. \newcommand{\negatedEdge}[3][]{
  195. \path[] (#2) edge [#1] node [midway,draw,circle,fill=black,transform shape,inner sep=0pt,minimum size=0.3em] (ref) {} (#3);
  196. }
  197. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  198. \NewEnviron{egraph}[1][1.5cm]{%
  199. \begin{tikzpicture}[-,
  200. >=stealth',
  201. shorten >=1pt,
  202. auto,
  203. node distance=#1,
  204. thick,
  205. base node/.style={circle,draw,minimum size=20pt}]
  206. \BODY
  207. \end{tikzpicture}
  208. }
  209. \newcommand{\chord}[2]{
  210. \draw[dashed,red] (#1) -- (#2);
  211. }
  212. \newcommand{\egraphFuncConstraint}[3]{%
  213. &((e_{#1=#2}~\land~e_{#2=#3})~\imp~e_{#1=#3})~\land\\
  214. &((e_{#1=#2}~\land~e_{#1=#3})~\imp~e_{#2=#3})~\land\\
  215. &((e_{#1=#3}~\land~e_{#2=#3})~\imp~e_{#1=#2})
  216. }
  217. \newcommand{\eq}[2]{
  218. e_{#1=#2}
  219. }
  220. \newcommand{\ackermannFuncConstraint}[3]{%
  221. (#2=#3~\imp~#1_{#2}=#1_{#3})
  222. }
  223. \newcommand{\DNF}[1]{\ensuremath{\text{DNF}(#1})}
  224. \newcommand{\CNF}[1]{\ensuremath{\text{CNF}(#1})}
  225. \newcommand{\satUnsatAss}[2]{{\color{blue}\ensuremath{#1}}|{\color{red}\ensuremath{#2}}}