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.

258 lines
7.0 KiB

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