Advertisement
froleyks

sat.tex

Jan 11th, 2021
1,591
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.12 KB | None | 0 0
  1. \def\T{\hbox to 1.5em{\hfill}}
  2. \def\N{\\}
  3. \def\CC#1{&{{\color{black}{// #1}}}}
  4. \def\C#1{\CC{#1} \\}
  5. \def\K#1{\textsf{#1}}
  6. \def\I#1{\mbox{\textrm{#1}}}
  7. \def\L#1{\raise .2ex\hbox{\scriptsize{$#1$}}&}
  8. \begin{tabular}{r@{\qquad}l@{\qquad\quad}l}
  9. %
  10. \L{ 1} \K{function} \I{sat} ($r$, $\sigma$)          \C{returns Boolean value $\BOOLE = \{0,1\}$}
  11. \L{ 2} \T \K{while} $\sigma (r) \neq 1$              \C{while not satisfied}
  12. \L{ 3} \T \T $g = r$, $t = 1$                        \C{initialize path as root path}
  13. \L{ 4} \T \T \K{while} $\neg \I{leaf}(g)$            \C{while current node is an operator}
  14. \L{ 5} \T \T \T $n = \I{child} (\sigma, t, g)$       \C{select backtracing node}
  15. \L{ 6} \T \T \T $x = \I{value} (\sigma, t, g, n)$    \C{select backtracing value}
  16. \L{ 7} \T \T \T $g = n$, $t = x$                     \C{backtracing step (propagation)}
  17. \L{ 8} \T \T \K{if} $\neg \I{constant} (g)$          \C{check if leaf is variable $v = g$}
  18. \L{ 9} \T \T \T $\sigma = \I{update} (\sigma, g, t)$ \C{apply move to variable $v = g$}
  19. \L{10} \T \K{return} $1$                             \CC{return with $1$ (\emph{true}) if satisfied}
  20. %
  21. \end{tabular}
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement