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.

292 lines
7.9 KiB

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