Browse Source

init commit

main
sp 3 months ago
parent
commit
0a6fab7be4
  1. 198
      .drone.yml
  2. 314
      .gitignore
  3. 32
      bdds/0001.tex
  4. 38
      bdds/0001_sol.tex
  5. 33
      bdds/0002.tex
  6. 4
      bdds/0002_sol.tex
  7. 32
      bdds/0003.tex
  8. 7
      bdds/0003_sol.tex
  9. 29
      bdds/0004.tex
  10. 17
      bdds/0004_sol.tex
  11. 19
      bdds/0005.tex
  12. 15
      bdds/0005_sol.tex
  13. 2
      bdds/0006.tex
  14. 3
      bdds/0006_sol.tex
  15. 34
      bdds/0007.tex
  16. 5
      bdds/0007_sol.tex
  17. 1
      bdds/0008.tex
  18. 38
      bdds/0008_sol.tex
  19. 3
      bdds/0009.tex
  20. 50
      bdds/0009_sol.tex
  21. 3
      bdds/0010.tex
  22. 57
      bdds/0010_sol.tex
  23. 5
      bdds/0011.tex
  24. 207
      bdds/0011_sol.tex
  25. 5
      bdds/0012.tex
  26. 136
      bdds/0012_sol.tex
  27. 5
      bdds/0013.tex
  28. 115
      bdds/0013_sol.tex
  29. 5
      bdds/0014.tex
  30. 140
      bdds/0014_sol.tex
  31. 5
      bdds/0015.tex
  32. 184
      bdds/0015_sol.tex
  33. 5
      bdds/0016.tex
  34. 183
      bdds/0016_sol.tex
  35. 5
      bdds/0017.tex
  36. 206
      bdds/0017_sol.tex
  37. 5
      bdds/0018.tex
  38. 160
      bdds/0018_sol.tex
  39. 4
      bdds/1005.tex
  40. 10
      bdds/1006.tex
  41. 9
      bdds/1008.tex
  42. 1
      bdds/1009.tex
  43. 1
      bdds/1010.tex
  44. 1
      bdds/1011.tex
  45. 29
      bdds/1012.tex
  46. 29
      bdds/1013.tex
  47. 27
      bdds/1014.tex
  48. 1
      bdds/1015.tex
  49. 8
      bdds/1016.tex
  50. 6
      bdds/1017.tex
  51. 1
      bdds/1018.tex
  52. 22
      bdds/1019.tex
  53. 21
      bdds/1020.tex
  54. 26
      bdds/1021.tex
  55. 28
      bdds/1022.tex
  56. 29
      bdds/1023.tex
  57. 1
      bdds/1024.tex
  58. 7
      bdds/1025.tex
  59. 44
      bdds/1025_sol.tex
  60. 6
      bdds/1026.tex
  61. 91
      bdds/1026_sol.tex
  62. 7
      bdds/1027.tex
  63. 67
      bdds/1027_sol.tex
  64. 7
      bdds/1028.tex
  65. 138
      bdds/1028_sol.tex
  66. 7
      bdds/1029.tex
  67. 162
      bdds/1029_sol.tex
  68. 36
      bdds/1030.tex
  69. 39
      bdds/1031.tex
  70. 10
      bdds/1031_sol.tex
  71. 29
      bdds/1032.tex
  72. 18
      bdds/1032_sol.tex
  73. 5
      bdds/1033.tex
  74. 21
      bdds/1033_sol.tex
  75. 5
      bdds/1034.tex
  76. 40
      bdds/1034_sol.tex
  77. 5
      bdds/1035.tex
  78. 49
      bdds/1035_sol.tex
  79. 11
      bdds/1036.tex
  80. 100
      bdds/1036_sol.tex
  81. 1
      bdds/2018.tex
  82. 2
      bdds/2019.tex
  83. 175
      bdds/bdds.tex
  84. 18
      compile
  85. BIN
      figures/computation_tree.png
  86. BIN
      figures/kripke5.png
  87. 68
      main.tex
  88. 2
      no_solution.tex
  89. 9
      propositional_logic/0001.tex
  90. 9
      propositional_logic/0001_sol.tex
  91. 7
      propositional_logic/0002.tex
  92. 14
      propositional_logic/0002_sol.tex
  93. 7
      propositional_logic/0003.tex
  94. 13
      propositional_logic/0003_sol.tex
  95. 1
      propositional_logic/0004.tex
  96. 5
      propositional_logic/0004_sol.tex
  97. 5
      propositional_logic/0004_sol.tex~
  98. 10
      propositional_logic/0005.tex
  99. 9
      propositional_logic/0005_sol.tex
  100. 2
      propositional_logic/0006.tex

198
.drone.yml

@ -0,0 +1,198 @@
kind: pipeline
type: docker
name: compile
steps:
- name: compile individual chapters
image: stpranger/latex-minted-latexmk
commands:
- chmod +x compile
- ./compile -d -b
- ./compile -d -b solution
when:
ref:
exclude:
- refs/tags/release_complete*
- name: compile complete questionnaire
image: stpranger/latex-minted-latexmk
commands:
- chmod +x compile
- ./compile -d
- ./compile -d solution
when:
ref:
include:
- refs/tags/release_complete*
- name: release complete questionnaire
image: plugins/gitea-release
settings:
base_url: https://git.pranger.xyz
api_key:
from_secret: gitea_token
files:
- questionnaire.pdf
- questionnaire_with_solutions.pdf
when:
ref:
include:
- refs/tags/release_complete*
- name: release chapter smtzthree
image: plugins/gitea-release
settings:
base_url: https://git.pranger.xyz
api_key:
from_secret: gitea_token
files:
- questionnaire_smtzthree.pdf
- questionnaire_with_solutions_smtzthree.pdf
when:
ref:
include:
- refs/tags/release_smtzthree*
- name: release chapter proplogic
image: plugins/gitea-release
settings:
base_url: https://git.pranger.xyz
api_key:
from_secret: gitea_token
files:
- questionnaire_proplogic.pdf
- questionnaire_with_solutions_proplogic.pdf
when:
ref:
include:
- refs/tags/release_proplogic*
- name: release chapter satsolver
image: plugins/gitea-release
settings:
base_url: https://git.pranger.xyz
api_key:
from_secret: gitea_token
files:
- questionnaire_satsolver.pdf
- questionnaire_with_solutions_satsolver.pdf
when:
ref:
include:
- refs/tags/release_satsolver*
- name: release chapter ndprop
image: plugins/gitea-release
settings:
base_url: https://git.pranger.xyz
api_key:
from_secret: gitea_token
files:
- questionnaire_ndprop.pdf
- questionnaire_with_solutions_ndprop.pdf
when:
ref:
include:
- refs/tags/release_ndprop*
- name: release chapter predlogic
image: plugins/gitea-release
settings:
base_url: https://git.pranger.xyz
api_key:
from_secret: gitea_token
files:
- questionnaire_predlogic.pdf
- questionnaire_with_solutions_predlogic.pdf
when:
ref:
include:
- refs/tags/release_predlogic*
- name: release chapter ndpred
image: plugins/gitea-release
settings:
base_url: https://git.pranger.xyz
api_key:
from_secret: gitea_token
files:
- questionnaire_ndpred.pdf
- questionnaire_with_solutions_ndpred.pdf
when:
ref:
include:
- refs/tags/release_ndpred*
- name: release chapter smt
image: plugins/gitea-release
settings:
base_url: https://git.pranger.xyz
api_key:
from_secret: gitea_token
files:
- questionnaire_smt.pdf
- questionnaire_with_solutions_smt.pdf
when:
ref:
include:
- refs/tags/release_smt*
- name: release chapter bdd
image: plugins/gitea-release
settings:
base_url: https://git.pranger.xyz
api_key:
from_secret: gitea_token
files:
- questionnaire_bdd.pdf
- questionnaire_with_solutions_bdd.pdf
when:
ref:
include:
- refs/tags/release_bdd*
- name: release chapter eqchecking
image: plugins/gitea-release
settings:
base_url: https://git.pranger.xyz
api_key:
from_secret: gitea_token
files:
- questionnaire_eqchecking.pdf
- questionnaire_with_solutions_eqchecking.pdf
when:
ref:
include:
- refs/tags/release_eqchecking*
- name: release chapter symbenc
image: plugins/gitea-release
settings:
base_url: https://git.pranger.xyz
api_key:
from_secret: gitea_token
files:
- questionnaire_symbenc.pdf
- questionnaire_with_solutions_symbenc.pdf
when:
ref:
include:
- refs/tags/release_symbenc*
- name: release chapter temporal
image: plugins/gitea-release
settings:
base_url: https://git.pranger.xyz
api_key:
from_secret: gitea_token
files:
- questionnaire_temporal.pdf
- questionnaire_with_solutions_temporal.pdf
when:
ref:
include:
- refs/tags/release_temporal*
trigger:
event:
include:
- push
- tag

314
.gitignore

@ -0,0 +1,314 @@
# source: https://github.com/github/gitignore/blob/main/TeX.gitignore
## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
*.fmt
*.fot
*.cb
*.cb2
.*.lb
*.d
## Intermediate documents:
*.dvi
*.xdv
*-converted-to.*
# these rules might exclude image files for figures etc.
# *.ps
# *.eps
# *.pdf
## Generated if empty string is given at "Please type another file name for output:"
.pdf
## Bibliography auxiliary files (bibtex/biblatex/biber):
*.bbl
*.bcf
*.blg
*-blx.aux
*-blx.bib
*.run.xml
## Build tool auxiliary files:
*.fdb_latexmk
*.synctex
*.synctex(busy)
*.synctex.gz
*.synctex.gz(busy)
*.pdfsync
## Build tool directories for auxiliary files
# latexrun
latex.out/
## Auxiliary and intermediate files from other packages:
# algorithms
*.alg
*.loa
# achemso
acs-*.bib
# amsthm
*.thm
# beamer
*.nav
*.pre
*.snm
*.vrb
# changes
*.soc
# comment
*.cut
# cprotect
*.cpt
# elsarticle (documentclass of Elsevier journals)
*.spl
# endnotes
*.ent
# fixme
*.lox
# feynmf/feynmp
*.mf
*.mp
*.t[1-9]
*.t[1-9][0-9]
*.tfm
#(r)(e)ledmac/(r)(e)ledpar
*.end
*.?end
*.[1-9]
*.[1-9][0-9]
*.[1-9][0-9][0-9]
*.[1-9]R
*.[1-9][0-9]R
*.[1-9][0-9][0-9]R
*.eledsec[1-9]
*.eledsec[1-9]R
*.eledsec[1-9][0-9]
*.eledsec[1-9][0-9]R
*.eledsec[1-9][0-9][0-9]
*.eledsec[1-9][0-9][0-9]R
# glossaries
*.acn
*.acr
*.glg
*.glo
*.gls
*.glsdefs
*.lzo
*.lzs
*.slg
*.slo
*.sls
# uncomment this for glossaries-extra (will ignore makeindex's style files!)
# *.ist
# gnuplot
*.gnuplot
*.table
# gnuplottex
*-gnuplottex-*
# gregoriotex
*.gaux
*.glog
*.gtex
# htlatex
*.4ct
*.4tc
*.idv
*.lg
*.trc
*.xref
# hyperref
*.brf
# knitr
*-concordance.tex
# TODO Uncomment the next line if you use knitr and want to ignore its generated tikz files
# *.tikz
*-tikzDictionary
# listings
*.lol
# luatexja-ruby
*.ltjruby
# makeidx
*.idx
*.ilg
*.ind
# minitoc
*.maf
*.mlf
*.mlt
*.mtc[0-9]*
*.slf[0-9]*
*.slt[0-9]*
*.stc[0-9]*
# minted
_minted*
*.pyg
# morewrites
*.mw
# newpax
*.newpax
# nomencl
*.nlg
*.nlo
*.nls
# pax
*.pax
# pdfpcnotes
*.pdfpc
# sagetex
*.sagetex.sage
*.sagetex.py
*.sagetex.scmd
# scrwfile
*.wrt
# svg
svg-inkscape/
# sympy
*.sout
*.sympy
sympy-plots-for-*.tex/
# pdfcomment
*.upa
*.upb
# pythontex
*.pytxcode
pythontex-files-*/
# tcolorbox
*.listing
# thmtools
*.loe
# TikZ & PGF
*.dpth
*.md5
*.auxlock
# titletoc
*.ptc
# todonotes
*.tdo
# vhistory
*.hst
*.ver
# easy-todo
*.lod
# xcolor
*.xcp
# xmpincl
*.xmpi
# xindy
*.xdy
# xypic precompiled matrices and outlines
*.xyc
*.xyd
# endfloat
*.ttt
*.fff
# Latexian
TSWLatexianTemp*
## Editors:
# WinEdt
*.bak
*.sav
# Texpad
.texpadtmp
# LyX
*.lyx~
# Kile
*.backup
# gummi
.*.swp
# KBibTeX
*~[0-9]*
# TeXnicCenter
*.tps
# auto folder when using emacs and auctex
./auto/*
*.el
# expex forward references with \gathertags
*-tags.tex
# standalone packages
*.sta
# Makeindex log files
*.lpz
# xwatermark package
*.xwm
# REVTeX puts footnotes in the bibliography by default, unless the nofootinbib
# option is specified. Footnotes are the stored in a file with suffix Notes.bib.
# Uncomment the next line to have this generated file ignored.
#*Notes.bib
# Mac
.DS_Store
.nova
# Do not allow pushing of compiled files
*.pdf
util/chapter.tex
util/toggle.tex

32
bdds/0001.tex

@ -0,0 +1,32 @@
\item \lect Given the \textit{Binary Decision Diagram (BDD)} below, label and explain the different elements of the diagram.
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=2mm,
l sep=4mm}
[$f$, rectangle, draw, tikz={\draw [line] () to (a.north);}
[$a$, name=a, tikz={\draw [line] () to (b.north east); \draw [dot=.5] () to (c2.north west);}
[$b$, name=b, tikz={\draw [dot=.5, bend left] () to (c1.north east); \draw [line, bend right] () to (c1.north west);}
[$c$, name=c1, s sep=20mm, tikz={\draw [line] () to (one.north); \draw [dot=.5] () to (e.north west);}
[,phantom]
[$e$, name=e, s sep=10mm, tikz={\draw [line, bend left] () to (one.north east); \draw [dot=.5, bend left] () to (one.east);}
[$1$, rectangle, draw, name=one]
[$0$, rectangle, draw, name=zero]
]
]
]
[$c$, name=c2, tikz={\draw [line, bend right] () to (e.north); \draw [dot=.5, bend left] () to (d.north);}
[,phantom]
[$d$, name=d, tikz={\draw [line] () to (e.north east); \draw[dot=.5] () to (zero.north);
}
[,phantom]
[,phantom]
]
]
]
]
\end{forest}
\end{center}

38
bdds/0001_sol.tex

@ -0,0 +1,38 @@
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=2mm,
l sep=4mm}
[$f$, rectangle, draw, tikz={\draw [line] () to (a.north);}
[$a$, name=a, tikz={\draw [line] () to node[pos=.7, above] {\scriptsize T \;} (b.north east); \draw [dot=.5] () to node[pos=.5, above] {\; \scriptsize E} (c2.north west);}
[$b$, name=b, tikz={\draw [dot=.5, bend left] () to node[pos=.5, right] {\scriptsize E \;} (c1.north east); \draw [line, bend right] () to node[pos=.5, left] {\; \scriptsize T} (c1.north west);}
[$c$, name=c1, s sep=20mm, tikz={\draw [line] () to node[pos=.7, left] {\scriptsize T \;} (one.north); \draw [dot=.5] () to node[pos=.5, above] {\; \scriptsize E} (e.north west);}
[,phantom]
[$e$, name=e, s sep=10mm, tikz={\draw [line, bend left] () to node[pos=.7, above] {\scriptsize T \;} (one.north east); \draw [dot=.5, bend left] () to node[pos=.2, below] {\; \scriptsize E} (one.east);}
[$1$, rectangle, draw, name=one]
[$0$, rectangle, draw, name=zero]
]
]
]
[$c$, name=c2, tikz={\draw [line, bend right] () to node[pos=.3, above] {\scriptsize T \;} (e.north); \draw [dot=.5, bend left] () to node[pos=.5, above] {\; \scriptsize E} (d.north);}
[,phantom]
[$d$, name=d, tikz={\draw [line] () to node[pos=.7, above] {\scriptsize T \;} (e.north east); \draw[dot=.5] () to node[pos=.3, below] {\; \scriptsize E} (zero.north);
}
[,phantom]
[,phantom]
]
]
]
]
\end{forest}
\end{center}
A binary decision diagram represents a Boolean formula $f$. It is a DAG with two terminal nodes that are
labelled with 0 and 1. The internal nodes are labelled with the Boolean variables
of the formula (here a, b, c, d and e). Each internal node has exactly two outgoing
edges: one edge labeled with a T (the then-edge), and another edge that
is labeled with an E (the else-edge) or marked with a circle. There is a unique
initial node called the function node labeled with $f$ that does not have any incoming edges and one outgoing edge to the internal variable node on the first
level.

33
bdds/0002.tex

@ -0,0 +1,33 @@
\item \lect Given the \textit{Binary Decision Diagram (BDD)} below,
find a satisfying and a falsifying model of $f$.
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=2mm,
l sep=4mm}
[$f$, rectangle, draw, tikz={\draw [line] () to (a.north);}
[$a$, name=a, tikz={\draw [line] () to (b.north east); \draw [dot=.5] () to (c2.north west);}
[$b$, name=b, tikz={\draw [dot=.5, bend left] () to (c1.north east); \draw [line, bend right] () to (c1.north west);}
[$c$, name=c1, s sep=20mm, tikz={\draw [line] () to (one.north); \draw [dot=.5] () to (e.north west);}
[,phantom]
[$e$, name=e, s sep=10mm, tikz={\draw [line, bend left] () to (one.north east); \draw [dot=.5, bend left] () to (one.east);}
[$1$, rectangle, draw, name=one]
[$0$, rectangle, draw, name=zero]
]
]
]
[$c$, name=c2, tikz={\draw [line, bend right] () to (e.north); \draw [dot=.5, bend left] () to (d.north);}
[,phantom]
[$d$, name=d, tikz={\draw [line] () to (e.north east); \draw[dot=.5] () to (zero.north);
}
[,phantom]
[,phantom]
]
]
]
]
\end{forest}
\end{center}

4
bdds/0002_sol.tex

@ -0,0 +1,4 @@
\begin{enumerate}
\item $\mathcal{M}_1$ = \{a = $\top$, b = $\top$, c = $\top$\}
\item $\mathcal{M}_2$ = \{a = $\bot$, c = $\bot$, d = $\bot$\}
\end{enumerate}

32
bdds/0003.tex

@ -0,0 +1,32 @@
\item \lect Given the following \textit{Binary Decision Diagram (BDD)} that represents the formula $f$. Compute its disjunctive normal form \DNF{f}.
\TODONOTE{THIS IS BULLCRAP.}
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=2mm,
l sep=4mm}
[$f$, rectangle, draw, tikz={\draw [line] () to (a.north);}
[$a$, name=a, tikz={\draw [line] () to (b.north east); \draw [dot=.5] () to (c2.north west);}
[$b$, name=b, tikz={\draw [dot=.5, bend left] () to (c1.north east); \draw [line, bend right] () to (c1.north west);}
[$c$, name=c1, s sep=20mm, tikz={\draw [line] () to (one.north); \draw [dot=.5] () to (e.north west);}
[,phantom]
[$e$, name=e, s sep=10mm, tikz={\draw [line, bend left] () to (one.north east); \draw [dot=.5, bend left] () to (one.east);}
[$1$, rectangle, draw, name=one]
[$0$, rectangle, draw, name=zero]
]
]
]
[$c$, name=c2, tikz={\draw [line, bend right] () to (e.north); \draw [dot=.5, bend left] () to (d.north);}
[,phantom]
[$d$, name=d, tikz={\draw [line] () to (e.north east); \draw[dot=.5] () to (zero.north);
}
[,phantom]
[,phantom]
]
]
]
]
\end{forest}
\end{center}

7
bdds/0003_sol.tex

@ -0,0 +1,7 @@
\begin{center}
$f = (a \land b \land c) \lor (a \land \lnot b \land c) \lor (a \land b \land \lnot c \land e) \lor (a \land \lnot b \land \lnot c \land e) \lor
\newline
(a \land b \land \lnot c \land \lnot e) \lor (a \land \lnot b \land \lnot c \land \lnot e) \lor (\lnot a \land c \land e) \lor (\lnot a \land c \land \lnot e) \lor
\newline
(\lnot a \land \lnot c \land d \land e) \lor (\lnot a \land \lnot c \land d \land \lnot e)$
\end{center}

29
bdds/0004.tex

@ -0,0 +1,29 @@
\item \BDDToROBDD
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=2mm,
l sep=2mm}
[$f$, rectangle, draw, tikz={\draw [line] () to (a.north);}
[$a$, name=a, tikz={\draw [line] () to (b1.north east); \draw [dot=.5] () to (b2.north west);}
[$b$, name=b1, tikz={\draw [line] () to (c1.north); \draw [dot=.5] () to (c2.north);}
[$c$, name=c1, tikz={\draw [line, bend right] () to (one.west); \draw [dot=.5, bend right] () to (zero.west);}]
[$c$, l sep=15mm, name=c2, tikz={\draw [line, bend right] () to (one.north); \draw [dot=.5, bend right] () to (zero.north west);}
[$1$, rectangle, draw, name=one]
[,phantom]
]
]
[$b$, name=b2, tikz={\draw [line] () to (c3.north); \draw [dot=.5] () to (c4.north);}
[$c$, l sep=15mm, name=c3, tikz={\draw [line, bend left] (.south) to (one.east); \draw [dot=.3, bend left] (.south east) to (one.south east);}
[,phantom]
[$0$, rectangle, draw, name=zero]
]
[$c$, name=c4, tikz={\draw [line, bend left] (.south) to (zero.north); \draw [dot=.5, bend left] () to (zero.north east);}]
]
]
]
\end{forest}
\end{center}

17
bdds/0004_sol.tex

@ -0,0 +1,17 @@
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=2mm,
l sep=2mm}
[$f$, rectangle, draw, tikz={\draw [line] () to (a.north);}
[$a$, name=a, tikz={\draw [line] () to (c1.north east); \draw [dot=.5] () to (b1.north west);}
[$c$, name=c1, tikz={\draw [line] () to (250:3); \draw [fulldot=.5] () to (265:3);}
]
[$b$, name=b1, tikz={\draw [line] () to (270:3); \draw [fulldot=.5] () to (285:3);}
]
]
]
\end{forest}
\end{center}

19
bdds/0005.tex

@ -0,0 +1,19 @@
\item \BDDToROBDD
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=5mm,
l sep=5mm}
[$f$, rectangle, draw, tikz={\draw [line] () to (a.north);}
[$a$, name=a, tikz={\draw [line, bend right] () to (b.north west); \draw [fulldot=.5, bend left] () to (b.north east);}
[$b$, name=b, tikz={\draw [line] () to (c1.north); \draw [dot=.5] () to (c2.north);}
[$c$, name=c1, tikz={\draw [line] () to (256:4.6); \draw [fulldot=.5] () to (268:4.5);}]
[$c$, name=c2, tikz={\draw [line] () to (272:4.5); \draw [fulldot=.5] () to (284:4.6);}]
]
]
]
\end{forest}
\end{center}

15
bdds/0005_sol.tex

@ -0,0 +1,15 @@
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=5mm,
l sep=5mm}
[$f$, rectangle, draw, tikz={\draw [line] () to (a.north);}
[$a$, name=a, tikz={\draw [line, bend right] () to (c.north west); \draw [fulldot=.5, bend left] () to (c.north east);}
[$c$, name=c, tikz={\draw [line] () to (260:3.4); \draw [fulldot=.5] () to (280:3.4);}
]
]
]
\end{forest}
\end{center}

2
bdds/0006.tex

@ -0,0 +1,2 @@
\item A reduced and ordered BDD is a canonical representation of a propositional formula.
Explain the term \textit{canonical} in the context of propositional formulas and explain why reduced and ordered BDDs give canonical representations.

3
bdds/0006_sol.tex

@ -0,0 +1,3 @@
A canonical representation means, that for any two semantically equivalent formulas $f_1$ and $f_2$ and a fixed variable order, $f_1$ and $f_2$ are represented by the same reduced and ordered BDD.
Since semantically equivalent formulas have the same set of satisfying models and a reduced and ordered BDD does not have redundancies, the representation of $f_1$ and $f_2$ are the same.

34
bdds/0007.tex

@ -0,0 +1,34 @@
\item \BDDToDNF
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=2mm,
l sep=1mm}
[$f$, rectangle, draw, tikz={\draw [line] () to (a.north);}
[$a$, name=a, tikz={\draw [line] () to (b.north east); \draw [fulldot=.5] () to (c2.north west);}
[$b$, name=b, tikz={\draw [dot=.5] () to (e.north); \draw [line] () to (c1.north);}
[$c$, name=c1, s sep=20mm, tikz={\draw [line] () to (240:4.2); \draw [fulldot=.5] () to (e.north west);}
[,phantom]
[$e$, name=e, s sep=10mm, tikz={\draw [fulldot=.5] () to (zero.north); \draw [line] () to (one.north);}
[,phantom, name=one]
[,phantom, name=zero]
]
]
[,phantom]
]
[$c$, name=c2, tikz={\draw [line] () to (e.north); \draw [fulldot=.5] () to (d.north);}
[,phantom]
[$d$, name=d, tikz={\draw [line] () to (e.north east); \draw[dot=.5] () to (300:4.2);
}
[,phantom]
[,phantom]
]
]
]
]
\end{forest}
\end{center}

5
bdds/0007_sol.tex

@ -0,0 +1,5 @@
\begin{center}
$f = (a \land b \land c) \lor (a \land \lnot b \land e) \lor (a \land b \land \lnot c \land \lnot e) \lor (\lnot a \land \lnot c \land d) \lor
\newline
(\lnot a \land c \land \lnot e) \lor (\lnot a \land \lnot c \land d \land e)$
\end{center}

1
bdds/0008.tex

@ -0,0 +1 @@
\item \constructROBDD{f = ((a \land b) \lor \lnot a \lor(c \biimp d)}{\textit{alphabetic variable order}}

38
bdds/0008_sol.tex

@ -0,0 +1,38 @@
\begin{cofactors}
$f_{a}$ \= $= b \lor(c \biimp d)$ \\
\>$f_{ab}$ \= $= \true $\\
\>$f_{a\lnot b}$ \= $= c \biimp d$ \\
\>\>$f_{a\lnot bc}$ \= $= d$ \\
\>\>\>$f_{a\lnot b c d}$ \= $= \true$ \\
\>\>\>$f_{a\lnot bc\lnot d}$ \= $= \false$ \\
\>\>$f_{a\lnot b\lnot c}$ \= $= \lnot d = f_{abc}$ \\
$f_{\lnot a}$ \= $=\true $
\end{cofactors}
The final ROBDD:\\
\begin{center}
\begin{bdd}
\node[func node] (f) {$f$};
\node[cofactor] (a1) [below of=f] {$a$};
\node[phantom] (aR) [below right of=a1] {};
\node[cofactor] (b1) [below left of=a1] {$b$};
\node[phantom] (bL) [below left of=b1] {};
\node[cofactor] (c1) [below right of=b1] {$c$};
\node[cofactor] (d1) [below of=c1] {$d$};
\node[phantom] (dL) [below left of=d1] {};
\node[phantom] (dR) [below right of=d1] {};
\funcEdge{f}{a1}
\thenEdge{a1}{b1}
\elseEdge{a1}{aR}
\thenEdge{b1}{bL}
\elseEdge{b1}{c1}
\thenEdge[bend right]{c1}{d1}
\negatedEdge[bend left]{c1}{d1}
\thenEdge{d1}{dL}
\elseEdge{d1}{dR}
\end{bdd}
\end{center}

3
bdds/0009.tex

@ -0,0 +1,3 @@
\item \constructROBDD{
f = (r \land p) \lor (\neg r \land \neg p) \lor (s \land \neg r) \lor (\neg s \land r)\lor (\lnot r \land q)
}{\textit{variable order} $p < q < r < s$}

50
bdds/0009_sol.tex

@ -0,0 +1,50 @@
\begin{cofactors}
$f_{p}$ \= $= r \lor(s \land \lnot r) \lor (\lnot s \land r) \lor (\lnot r \land q)$ \\
\>$f_{pq}$ \= $= r\lor (s \land \lnot r) \lor (\lnot s \land r)\lor \lnot r = \true $\\
\>$f_{p\lnot q}$ \= $= r\lor (s \land \lnot r)\lor (\lnot s \land r) $\\
\>\>$f_{p\lnot qr}$ \= $= \true $\\
\>\>$f_{p\lnot q\lnot r}$ \= $= s $\\
\>\>\>$f_{p\lnot q\lnot rs}$ \= $= \true $\\
\>\>\>$f_{p\lnot q\lnot r\lnot s}$ \= $= \false $\\
$f_{\lnot p}$ \= $= \lnot r \lor (s \land \lnot r) \lor (\lnot s \land r) \lor (\lnot r \land q) = \lnot r \lor (s \land \lnot r) \lor (\lnot s \land r)$ \\
\>$f_{\lnot pr}$ \= $= \lnot s = f_{p\lnot q\lnot r} $ \\
\>$f_{\lnot p\lnot r}$ \= $= \true $
\end{cofactors}
The final ROBDD:\\
\begin{center}
\begin{bdd}[4em]
\node[func node] (f) {$f$};
\node[cofactor] (p1) [below of=f] {$p$};
\node[cofactor] (q1) [below left of=p1] {$q$};
\node[cofactor] (r1) [below right of=p1,yshift=-2.75em,xshift=1.75em] {$r$};
\node[cofactor] (r2) [below right of=q1] {$r$};
\node[phantom] (q1L) [below left of=q1] {};
\node[phantom] (r1R) [below right of=r1] {};
\node[cofactor] (s1) [below right of=r2] {$s$};
\node[phantom] (r2L) [below left of=r2] {};
\node[phantom] (s2L) [below left of=s1] {};
\node[phantom] (s2R) [below right of=s1] {};
\funcEdge{f}{p1}
\thenEdge{p1}{q1}
\negatedEdge{p1}{r1}
\thenEdge{q1}{q1L}
\elseEdge{q1}{r2}
\thenEdge{r2}{r2L}
\elseEdge{r2}{s1}
\thenEdge{r1}{s1}
\negatedEdge{r1}{r1R}
\thenEdge{s1}{s2L}
\negatedEdge{s1}{s2R}
\end{bdd}
\end{center}

3
bdds/0010.tex

@ -0,0 +1,3 @@
\item \constructROBDD{
f = (r \land \neg p) \lor (\neg r \land p) \lor (s \land \neg r) \lor (\neg s \land r) \lor ( r \land q)
}{\textit{variable order} $p < q < r < s$}

57
bdds/0010_sol.tex

@ -0,0 +1,57 @@
$$f = (r \land \lnot p) \lor (r \land \lnot p) \lor (s \land \lnot r) \lor (\lnot s \land r)\lor (r \land q),$$
\begin{cofactors}
$f_{p}$ \= $= \lnot r \lor(s \land \lnot r) \lor (\lnot s \land r) \lor (r \land q)$ \\
\>$f_{pq}$ \= $= \true$\\
\>$f_{p\lnot q}$ \= $= r \lor (s \land \lnot r) \lor (\lnot s \land r)$\\
\>\>$f_{p\lnot qr}$ \= $= \true$\\
\>\>$f_{p\lnot q\lnot r}$ \= $= s$\\
\>\>\>$f_{p\lnot q\lnot rs}$ \= $= \true$\\
\>\>\>$f_{p\lnot q\lnot r\lnot s}$ \= $= \false$\\
$f_{\lnot p}$ \= $= r \lor(s \land \lnot r) \lor (\lnot s \land r) \lor (r \land q)$ \\
\>$f_{\lnot pq}$ \= $= r \lor(s \land \lnot r) \lor (\lnot s \land r)$ \\
\>$f_{\lnot p\lnot q}$ \= $= r \lor(s \land \lnot r) \lor (\lnot s \land r)$ \\
\>\>$\Rightarrow q$ does not have an influence on the formula. These cofactors can be skipped.\\
\>$f_{\lnot pr}$ \= $= \true$ \\
\>$f_{\lnot p\lnot r}$ \= $= s = f_{p\lnot q\lnot r}$ \\
\end{cofactors}
The final ROBDD:\\
\begin{center}
\begin{bdd}[4em]
\node[func node] (f) {$f$};
\node[cofactor] (p1) [below of=f] {$q$};
\node[cofactor] (q1) [below left of=p1] {$q$};
\node[cofactor] (r1) [below right of=p1] {$r$};
\node[cofactor] (r2) [below right of=q1,yshift=-0.8em,xshift=-1.5em] {$r$};
\node[phantom] (q1L) [below left of=q1] {};
\node[phantom] (r1L) [below left of=r1] {};
\node[cofactor] (s1) [below left of=r2] {$s$};
\node[phantom] (r2L) [below left of=r2] {};
\node[phantom] (r2R) [below right of=r2] {};
\node[phantom] (s2L) [below left of=s1] {};
\node[phantom] (s2R) [below right of=s1] {};
\funcEdge{f}{p1}
\thenEdge{p1}{q1}
\elseEdge{p1}{r1}
\thenEdge{q1}{q1L}
\negatedEdge{q1}{r2}
\thenEdge{r2}{s1}
\negatedEdge{r2}{r2R}
\thenEdge{r1}{r1L}
\elseEdge[bend left]{r1}{s1}
\thenEdge{s1}{s2L}
\negatedEdge{s1}{s2R}
\end{bdd}
\end{center}

5
bdds/0011.tex

@ -0,0 +1,5 @@
\item Construct a Reduced Ordered Binary Decision Diagram (ROBDD) for the formula
$$f = (p \land q) \lor (r \land \lnot s) \lor (\lnot p \land t \land u)$$
using \textit{alphabetic variable order}. Use complemented edges and a node for \texttt{true} as the only constant node. To simplify drawing, you may assume that \textit{dangling edges} point to the constant node. Write down all cofactors that you compute to obtain the final result and mark them in the graph.

207
bdds/0011_sol.tex

@ -0,0 +1,207 @@
\begin{cofactors}
$f$ \= $= (((p \land q) \lor (r \land \lnot s)) \lor ((\lnot p \land t) \land u))$\\
\>$f_{p}$ \= $= (q \lor (r \land \lnot s))$\\
\>\>$f_{pq}$ \= $= \true$\\
\>\>$f_{p\lnot q}$ \= $= (r \land \lnot s)$\\
\>\>\>$f_{p\lnot qr}$ \= $= \lnot s$\\
\>\>\>\>$f_{p\lnot qrs}$ \= $= \false$\\
\>\>\>\>$f_{p\lnot qr\lnot s}$ \= $= \true$\\
\>\>\>$f_{p\lnot q\lnot r}$ \= $= \false$\\
\>$f_{\lnot p}$ \= $= ((r \land \lnot s) \lor (t \land u))$\\
\>\>$f_{\lnot pr}$ \= $= (\lnot s \lor (t \land u))$\\
\>\>\>$f_{\lnot prs}$ \= $= (t \land u)$\\
\>\>\>\>$f_{\lnot prst}$ \= $= u$\\
\>\>\>\>\>$f_{\lnot prstu}$ \= $= \true$\\
\>\>\>\>\>$f_{\lnot prst\lnot u}$ \= $= \false$\\
\>\>\>\>$f_{\lnot prs\lnot t}$ \= $= \false$\\
\>\>\>$f_{\lnot pr\lnot s}$ \= $= \true$\\
\>\>$f_{\lnot p\lnot r}$ \= $= f_{\lnot prs}$\\
\end{cofactors}
The final ROBDD:
\begin{center}
\scalebox{0.75}{
\begin{tikzpicture}[>=latex,line join=bevel,]
\pgfsetlinewidth{1bp}
%%
\pgfsetcolor{black}
% Edge: f_E -> p0
\draw [] (128.5bp,326.99bp) .. controls (128.5bp,316.92bp) and (128.5bp,301.47bp) .. (128.5bp,291.3bp);
% Edge: f_p -> q1
\draw [] (174.49bp,268.99bp) .. controls (169.27bp,258.54bp) and (161.15bp,242.31bp) .. (156.09bp,232.18bp);
% Edge: f_p!q -> r2
\draw [] (198.75bp,210.99bp) .. controls (194.88bp,200.67bp) and (188.89bp,184.7bp) .. (185.08bp,174.55bp);
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (192.1bp,193.28bp) node {\Large$\bullet$};
% Edge: f_p!qr -> s3
\draw [] (231.61bp,152.99bp) .. controls (230.71bp,142.92bp) and (229.33bp,127.47bp) .. (228.42bp,117.3bp);
\draw (230.2bp,137.22bp) node {\Large$\bullet$};
% Edge: f_!p -> r4
\draw [] (82.685bp,268.99bp) .. controls (88.094bp,258.54bp) and (96.501bp,242.31bp) .. (101.74bp,232.18bp);
% Edge: f_!pr -> s5
\draw [] (21.5bp,210.99bp) .. controls (21.5bp,200.92bp) and (21.5bp,185.47bp) .. (21.5bp,175.3bp);
% Edge: f_!prs -> t6
\draw [] (73.394bp,152.99bp) .. controls (74.293bp,142.92bp) and (75.672bp,127.47bp) .. (76.58bp,117.3bp);
% Edge: f_!prst -> u7
\draw [] (161.32bp,94.988bp) .. controls (155.91bp,84.544bp) and (147.5bp,68.308bp) .. (142.26bp,58.183bp);
% Edge: p0 -> r4
\draw [] (124.77bp,269.5bp) .. controls (120.75bp,259.27bp) and (114.38bp,243.06bp) .. (110.32bp,232.73bp);
\draw (117.64bp,251.35bp) node {\Large$\circ$};
% Edge: p0 -> q1
\draw [] (132.4bp,269.5bp) .. controls (136.66bp,259.14bp) and (143.42bp,242.66bp) .. (147.66bp,232.36bp);
% Edge: r4 -> s5
\draw [] (97.724bp,215.22bp) .. controls (81.436bp,204.49bp) and (46.704bp,181.6bp) .. (30.356bp,170.83bp);
% Edge: r4 -> t6
\draw [] (107.27bp,210.63bp) .. controls (107.97bp,197.09bp) and (108.15bp,172.79bp) .. (102.5bp,153.0bp) .. controls (98.455bp,138.84bp) and (89.518bp,124.18bp) .. (83.501bp,115.32bp);
\draw (94.602bp,131.96bp) node {\Large$\circ$};
% Edge: s5 -> t6
\draw [] (28.821bp,155.68bp) .. controls (39.494bp,145.01bp) and (59.224bp,125.28bp) .. (69.998bp,114.5bp);
% Edge: s5 -> 7
\draw [] (21.5bp,152.99bp) .. controls (21.5bp,137.38bp) and (21.5bp,108.85bp) .. (21.5bp,107.09bp);
\draw (21.5bp,127.09bp) node {\Large$\circ$};
% Edge: t6 -> u7
\draw [] (85.344bp,97.679bp) .. controls (96.906bp,86.887bp) and (118.39bp,66.836bp) .. (129.84bp,56.146bp);
% Edge: t6 -> 6
\draw [] (77.5bp,94.988bp) .. controls (77.5bp,79.384bp) and (77.5bp,50.854bp) .. (77.5bp,49.086bp);
\draw (77.5bp,69.086bp) node {\Large$\bullet$};
% Edge: u7 -> 4
\draw [] (135.28bp,36.791bp) .. controls (132.43bp,23.663bp) and (127.8bp,2.3815bp) .. (127.51bp,1.0642bp);
% Edge: u7 -> 5
\draw [] (139.5bp,36.791bp) .. controls (142.07bp,23.663bp) and (146.23bp,2.3815bp) .. (146.49bp,1.0642bp);
\draw (142.65bp,20.692bp) node {\Large$\bullet$};
% Edge: q1 -> r2
\draw [] (156.32bp,212.0bp) .. controls (161.89bp,201.61bp) and (170.99bp,184.62bp) .. (176.59bp,174.16bp);
\draw (167.15bp,191.79bp) node {\Large$\bullet$};
% Edge: q1 -> 0
\draw [] (151.5bp,210.99bp) .. controls (151.5bp,195.38bp) and (151.5bp,166.85bp) .. (151.5bp,165.09bp);
% Edge: r2 -> s3
\draw [] (188.29bp,154.74bp) .. controls (197.08bp,144.03bp) and (212.32bp,125.48bp) .. (220.98bp,114.93bp);
% Edge: r2 -> 3
\draw [] (173.89bp,155.63bp) .. controls (164.66bp,146.64bp) and (148.71bp,130.93bp) .. (135.5bp,117.0bp) .. controls (131.64bp,112.93bp) and (127.11bp,107.7bp) .. (126.56bp,107.06bp);
\draw (139.66bp,122.18bp) node {\Large$\circ$};
% Edge: s3 -> 1
\draw [] (225.71bp,94.988bp) .. controls (222.93bp,79.384bp) and (217.83bp,50.854bp) .. (217.52bp,49.086bp);
% Edge: s3 -> 2
\draw [] (229.11bp,94.988bp) .. controls (231.62bp,79.384bp) and (236.2bp,50.854bp) .. (236.49bp,49.086bp);
\draw (233.31bp,68.833bp) node {\Large$\bullet$};
% Node: f_E
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (150.0bp,349.0bp) -- (107.0bp,349.0bp) -- (107.0bp,327.0bp) -- (150.0bp,327.0bp) -- cycle;
\draw (128.5bp,338.0bp) node {$f$};
\end{scope}
% Node: p0
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (128.5bp,280.0bp) ellipse (11.0bp and 11.0bp);
\draw (128.5bp,280.0bp) node {$p$};
\end{scope}
% Node: f_p
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (201.0bp,291.0bp) -- (158.0bp,291.0bp) -- (158.0bp,269.0bp) -- (201.0bp,269.0bp) -- cycle;
\draw (179.5bp,280.0bp) node {$f_{p}$};
\end{scope}
% Node: q1
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (151.5bp,222.0bp) ellipse (11.0bp and 11.0bp);
\draw (151.5bp,222.0bp) node {$q$};
\end{scope}
% Node: f_p!q
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (224.0bp,233.0bp) -- (181.0bp,233.0bp) -- (181.0bp,211.0bp) -- (224.0bp,211.0bp) -- cycle;
\draw (202.5bp,222.0bp) node {$f_{p\lnot q}$};
\end{scope}
% Node: r2
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (181.5bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (181.5bp,164.0bp) node {$r$};
\end{scope}
% Node: f_p!qr
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (254.0bp,175.0bp) -- (211.0bp,175.0bp) -- (211.0bp,153.0bp) -- (254.0bp,153.0bp) -- cycle;
\draw (232.5bp,164.0bp) node {$f_{p\lnot qr}$};
\end{scope}
% Node: s3
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (227.5bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (227.5bp,106.0bp) node {$s$};
\end{scope}
% Node: f_!p
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (99.0bp,291.0bp) -- (56.0bp,291.0bp) -- (56.0bp,269.0bp) -- (99.0bp,269.0bp) -- cycle;
\draw (77.5bp,280.0bp) node {$f_{\lnot p}$};
\end{scope}
% Node: r4
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (106.5bp,222.0bp) ellipse (11.0bp and 11.0bp);
\draw (106.5bp,222.0bp) node {$r$};
\end{scope}
% Node: f_!pr
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (43.0bp,233.0bp) -- (0.0bp,233.0bp) -- (0.0bp,211.0bp) -- (43.0bp,211.0bp) -- cycle;
\draw (21.5bp,222.0bp) node {$f_{\lnot pr}$};
\end{scope}
% Node: s5
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (21.5bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (21.5bp,164.0bp) node {$s$};
\end{scope}
% Node: f_!prs
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (94.0bp,175.0bp) -- (51.0bp,175.0bp) -- (51.0bp,153.0bp) -- (94.0bp,153.0bp) -- cycle;
\draw (72.5bp,164.0bp) node {$f_{\lnot prs}$};
\end{scope}
% Node: t6
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (77.5bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (77.5bp,106.0bp) node {$t$};
\end{scope}
% Node: f_!prst
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (188.0bp,117.0bp) -- (145.0bp,117.0bp) -- (145.0bp,95.0bp) -- (188.0bp,95.0bp) -- cycle;
\draw (166.5bp,106.0bp) node {$f_{\lnot prst}$};
\end{scope}
% Node: u7
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (137.5bp,48.0bp) ellipse (11.0bp and 11.0bp);
\draw (137.5bp,48.0bp) node {$u$};
\end{scope}
%
\end{tikzpicture}
}
\end{center}

5
bdds/0012.tex

@ -0,0 +1,5 @@
\item Construct a Reduced Ordered Binary Decision Diagram (ROBDD) for the formula
$$f = (p \land q) \lor (r \land s) \lor (\lnot p \land \lnot r)$$
using \textit{alphabetic variable order}. Use complemented edges and a node for \texttt{true} as the only constant node. To simplify drawing, you may assume that \textit{dangling edges} point to the constant node. Write down all cofactors that you compute to obtain the final result and mark them in the graph.

136
bdds/0012_sol.tex

@ -0,0 +1,136 @@
\begin{cofactors}
$f$ \= $= (((p \land q) \lor (r \land s)) \lor (\lnot p \land \lnot r))$\\
\>$f_{p}$ \= $= (q \lor (r \land s))$\\
\>\>$f_{pq}$ \= $= \true$\\
\>\>$f_{p\lnot q}$ \= $= (r \land s)$\\
\>\>\>$f_{p\lnot qr}$ \= $= s$\\
\>\>\>\>$f_{p\lnot qrs}$ \= $= \true$\\
\>\>\>\>$f_{p\lnot qr\lnot s}$ \= $= \false$\\
\>\>\>$f_{p\lnot q\lnot r}$ \= $= \false$\\
\>$f_{\lnot p}$ \= $= ((r \land s) \lor \lnot r)$\\
\>\>$f_{\lnot pr}$ \= $= f_{p\lnot qr}$\\
\>\>$f_{\lnot p\lnot r}$ \= $= \true$\\
\end{cofactors}
The final ROBDD:
\begin{center}
\scalebox{0.75}{
\begin{tikzpicture}[>=latex,line join=bevel,]
\pgfsetlinewidth{1bp}
%%
\pgfsetcolor{black}
% Edge: f_E -> p0
\draw [] (76.036bp,268.99bp) .. controls (76.036bp,258.92bp) and (76.036bp,243.47bp) .. (76.036bp,233.3bp);
% Edge: f_p -> q1
\draw [] (126.5bp,210.99bp) .. controls (125.96bp,200.92bp) and (125.13bp,185.47bp) .. (124.59bp,175.3bp);
% Edge: f_p!q -> r2
\draw [] (171.28bp,152.99bp) .. controls (167.41bp,142.67bp) and (161.42bp,126.7bp) .. (157.62bp,116.55bp);
% Edge: f_p!qr -> s3
\draw [] (84.036bp,94.988bp) .. controls (84.036bp,84.921bp) and (84.036bp,69.474bp) .. (84.036bp,59.304bp);
% Edge: f_!p -> r4
\draw [] (26.109bp,210.99bp) .. controls (27.188bp,200.92bp) and (28.843bp,185.47bp) .. (29.932bp,175.3bp);
% Edge: p0 -> r4
\draw [] (69.397bp,212.74bp) .. controls (60.889bp,202.15bp) and (46.225bp,183.9bp) .. (37.704bp,173.3bp);
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (50.231bp,188.89bp) node {\Large$\circ$};
% Edge: p0 -> q1
\draw [] (82.711bp,213.21bp) .. controls (91.778bp,202.63bp) and (107.91bp,183.81bp) .. (117.11bp,173.08bp);
% Edge: r4 -> s3
\draw [] (33.339bp,152.98bp) .. controls (36.665bp,139.41bp) and (43.48bp,114.64bp) .. (53.036bp,95.0bp) .. controls (59.948bp,80.799bp) and (70.727bp,65.915bp) .. (77.581bp,57.05bp);
% Edge: r4 -> 4
\draw [] (26.743bp,153.75bp) .. controls (19.589bp,138.34bp) and (5.9248bp,108.91bp) .. (5.0778bp,107.09bp);
\draw (13.5bp,125.23bp) node {\Large$\circ$};
% Edge: q1 -> r2
\draw [] (128.86bp,154.0bp) .. controls (134.42bp,143.61bp) and (143.53bp,126.62bp) .. (149.13bp,116.16bp);
\draw (139.68bp,133.79bp) node {\Large$\circ$};
% Edge: q1 -> 0
\draw [] (124.04bp,152.99bp) .. controls (124.04bp,137.38bp) and (124.04bp,108.85bp) .. (124.04bp,107.09bp);
% Edge: r2 -> s3
\draw [] (145.73bp,98.356bp) .. controls (132.26bp,87.578bp) and (105.8bp,66.407bp) .. (92.33bp,55.635bp);
% Edge: r2 -> 3
\draw [] (154.04bp,94.988bp) .. controls (154.04bp,79.384bp) and (154.04bp,50.854bp) .. (154.04bp,49.086bp);
\draw (154.04bp,69.086bp) node {\Large$\bullet$};
% Edge: s3 -> 1
\draw [] (82.039bp,36.791bp) .. controls (79.47bp,23.663bp) and (75.307bp,2.3815bp) .. (75.049bp,1.0642bp);
% Edge: s3 -> 2
\draw [] (86.256bp,36.791bp) .. controls (89.11bp,23.663bp) and (93.736bp,2.3815bp) .. (94.023bp,1.0642bp);
\draw (89.774bp,20.608bp) node {\Large$\bullet$};
% Node: f_E
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (97.54bp,291.0bp) -- (54.54bp,291.0bp) -- (54.54bp,269.0bp) -- (97.54bp,269.0bp) -- cycle;
\draw (76.036bp,280.0bp) node {$f$};
\end{scope}
% Node: p0
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (76.04bp,222.0bp) ellipse (11.0bp and 11.0bp);
\draw (76.036bp,222.0bp) node {$p$};
\end{scope}
% Node: f_p
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (148.54bp,233.0bp) -- (105.54bp,233.0bp) -- (105.54bp,211.0bp) -- (148.54bp,211.0bp) -- cycle;
\draw (127.04bp,222.0bp) node {$f_{p}$};
\end{scope}
% Node: q1
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (124.04bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (124.04bp,164.0bp) node {$q$};
\end{scope}
% Node: f_p!q
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (196.54bp,175.0bp) -- (153.54bp,175.0bp) -- (153.54bp,153.0bp) -- (196.54bp,153.0bp) -- cycle;
\draw (175.04bp,164.0bp) node {$f_{p\lnot q}$};
\end{scope}
% Node: r2
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (154.04bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (154.04bp,106.0bp) node {$r$};
\end{scope}
% Node: f_p!qr
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (105.54bp,117.0bp) -- (62.54bp,117.0bp) -- (62.54bp,95.0bp) -- (105.54bp,95.0bp) -- cycle;
\draw (84.036bp,106.0bp) node {$f_{p\lnot qr}$};
\end{scope}
% Node: s3
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (84.04bp,48.0bp) ellipse (11.0bp and 11.0bp);
\draw (84.036bp,48.0bp) node {$s$};
\end{scope}
% Node: f_!p
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (46.54bp,233.0bp) -- (3.54bp,233.0bp) -- (3.54bp,211.0bp) -- (46.54bp,211.0bp) -- cycle;
\draw (25.036bp,222.0bp) node {$f_{\lnot p}$};
\end{scope}
% Node: r4
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (31.04bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (31.036bp,164.0bp) node {$r$};
\end{scope}
%
\end{tikzpicture}
}
\end{center}

5
bdds/0013.tex

@ -0,0 +1,5 @@
\item Construct a Reduced Ordered Binary Decision Diagram (ROBDD) for the formula
$$f = (\lnot p \land q \land r) \lor (p \land \lnot s)$$
using \textit{alphabetic variable order}. Use complemented edges and a node for \texttt{true} as the only constant node. To simplify drawing, you may assume that \textit{dangling edges} point to the constant node. Write down all cofactors that you compute to obtain the final result and mark them in the graph.

115
bdds/0013_sol.tex

@ -0,0 +1,115 @@
\begin{cofactors}
$f$ \= $= (((\lnot p \land q) \land r) \lor (p \land \lnot s))$\\
\>$f_{p}$ \= $= \lnot s$\\
\>\>$f_{ps}$ \= $= \false$\\
\>\>$f_{p\lnot s}$ \= $= \true$\\
\>$f_{\lnot p}$ \= $= (q \land r)$\\
\>\>$f_{\lnot pq}$ \= $= r$\\
\>\>\>$f_{\lnot pqr}$ \= $= \true$\\
\>\>\>$f_{\lnot pq\lnot r}$ \= $= \false$\\
\>\>$f_{\lnot p\lnot q}$ \= $= \false$\\
\end{cofactors}
The final ROBDD:
\begin{center}
\scalebox{0.75}{
\begin{tikzpicture}[>=latex,line join=bevel,]
\pgfsetlinewidth{1bp}
%%
\pgfsetcolor{black}
% Edge: f_E -> p0
\draw [] (72.5bp,210.99bp) .. controls (72.5bp,200.92bp) and (72.5bp,185.47bp) .. (72.5bp,175.3bp);
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (72.5bp,195.3bp) node {\Large$\bullet$};
% Edge: f_p -> s1
\draw [] (123.5bp,152.99bp) .. controls (123.5bp,142.92bp) and (123.5bp,127.47bp) .. (123.5bp,117.3bp);
\draw (123.5bp,137.3bp) node {\Large$\bullet$};
% Edge: f_!p -> q2
\draw [] (21.5bp,152.99bp) .. controls (21.5bp,142.92bp) and (21.5bp,127.47bp) .. (21.5bp,117.3bp);
% Edge: f_!pq -> r3
\draw [] (70.712bp,94.988bp) .. controls (68.892bp,84.795bp) and (66.087bp,69.087bp) .. (64.272bp,58.925bp);
% Edge: p0 -> q2
\draw [] (65.409bp,155.21bp) .. controls (55.665bp,144.51bp) and (38.243bp,125.38bp) .. (28.531bp,114.72bp);
\draw (41.998bp,129.51bp) node {\Large$\bullet$};
% Edge: p0 -> s1
\draw [] (79.591bp,155.21bp) .. controls (89.335bp,144.51bp) and (106.76bp,125.38bp) .. (116.47bp,114.72bp);
% Edge: q2 -> r3
\draw [] (27.55bp,96.737bp) .. controls (35.301bp,86.149bp) and (48.662bp,67.901bp) .. (56.425bp,57.297bp);
% Edge: q2 -> 4
\draw [] (21.5bp,94.988bp) .. controls (21.5bp,79.384bp) and (21.5bp,50.854bp) .. (21.5bp,49.086bp);
\draw (21.5bp,69.086bp) node {\Large$\bullet$};
% Edge: r3 -> 2
\draw [] (60.281bp,36.791bp) .. controls (57.427bp,23.663bp) and (52.8bp,2.3815bp) .. (52.514bp,1.0642bp);
% Edge: r3 -> 3
\draw [] (64.497bp,36.791bp) .. controls (67.066bp,23.663bp) and (71.23bp,2.3815bp) .. (71.487bp,1.0642bp);
\draw (67.647bp,20.692bp) node {\Large$\bullet$};
% Edge: s1 -> 0
\draw [] (121.71bp,94.988bp) .. controls (118.93bp,79.384bp) and (113.83bp,50.854bp) .. (113.52bp,49.086bp);
% Edge: s1 -> 1
\draw [] (125.11bp,94.988bp) .. controls (127.62bp,79.384bp) and (132.2bp,50.854bp) .. (132.49bp,49.086bp);
\draw (129.31bp,68.833bp) node {\Large$\bullet$};
% Node: f_E
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (94.0bp,233.0bp) -- (51.0bp,233.0bp) -- (51.0bp,211.0bp) -- (94.0bp,211.0bp) -- cycle;
\draw (72.5bp,222.0bp) node {$f$};
\end{scope}
% Node: p0
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (72.5bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (72.5bp,164.0bp) node {$p$};
\end{scope}
% Node: f_p
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (145.0bp,175.0bp) -- (102.0bp,175.0bp) -- (102.0bp,153.0bp) -- (145.0bp,153.0bp) -- cycle;
\draw (123.5bp,164.0bp) node {$f_{p}$};
\end{scope}
% Node: s1
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (123.5bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (123.5bp,106.0bp) node {$s$};
\end{scope}
% Node: f_!p
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (43.0bp,175.0bp) -- (0.0bp,175.0bp) -- (0.0bp,153.0bp) -- (43.0bp,153.0bp) -- cycle;
\draw (21.5bp,164.0bp) node {$f_{\lnot p}$};
\end{scope}
% Node: q2
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (21.5bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (21.5bp,106.0bp) node {$q$};
\end{scope}
% Node: f_!pq
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (94.0bp,117.0bp) -- (51.0bp,117.0bp) -- (51.0bp,95.0bp) -- (94.0bp,95.0bp) -- cycle;
\draw (72.5bp,106.0bp) node {$f_{\lnot pq}$};
\end{scope}
% Node: r3
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (62.5bp,48.0bp) ellipse (11.0bp and 11.0bp);
\draw (62.5bp,48.0bp) node {$r$};
\end{scope}
%
\end{tikzpicture}
}
\end{center}

5
bdds/0014.tex

@ -0,0 +1,5 @@
\item Construct a Reduced Ordered Binary Decision Diagram (ROBDD) for the formula
$$f = (p \land q \land \lnot r) \lor (\lnot q \land s) \lor (\lnot p \land \lnot s)$$
using \textit{alphabetic variable order}. Use complemented edges and a node for \texttt{true} as the only constant node. To simplify drawing, you may assume that \textit{dangling edges} point to the constant node. Write down all cofactors that you compute to obtain the final result and mark them in the graph.

140
bdds/0014_sol.tex

@ -0,0 +1,140 @@
\begin{cofactors}
$f$ \= $= ((((p \land q) \land \lnot r) \lor (\lnot q \land s)) \lor (\lnot p \land \lnot s))$\\
\>$f_{p}$ \= $= ((q \land \lnot r) \lor (\lnot q \land s))$\\
\>\>$f_{pq}$ \= $= \lnot r$\\
\>\>\>$f_{pqr}$ \= $= \false$\\
\>\>\>$f_{pq\lnot r}$ \= $= \true$\\
\>\>$f_{p\lnot q}$ \= $= s$\\
\>\>\>$f_{p\lnot qs}$ \= $= \true$\\
\>\>\>$f_{p\lnot q\lnot s}$ \= $= \false$\\
\>$f_{\lnot p}$ \= $= ((\lnot q \land s) \lor \lnot s)$\\
\>\>$f_{\lnot pq}$ \= $= \lnot f_{p\lnot q}$\\
\>\>$f_{\lnot p\lnot q}$ \= $= \true$\\
\end{cofactors}
The final ROBDD:
\begin{center}
\scalebox{0.75}{
\begin{tikzpicture}[>=latex,line join=bevel,]
\pgfsetlinewidth{1bp}
%%
\pgfsetcolor{black}
% Edge: f_E -> p0
\draw [] (72.5bp,210.99bp) .. controls (72.5bp,200.92bp) and (72.5bp,185.47bp) .. (72.5bp,175.3bp);
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (72.5bp,195.3bp) node {\Large$\bullet$};
% Edge: f_p -> q1
\draw [] (123.5bp,152.99bp) .. controls (123.5bp,142.92bp) and (123.5bp,127.47bp) .. (123.5bp,117.3bp);
\draw (123.5bp,137.3bp) node {\Large$\bullet$};
% Edge: f_pq -> r2
\draw [] (165.92bp,94.988bp) .. controls (156.53bp,84.04bp) and (141.7bp,66.729bp) .. (133.15bp,56.763bp);
\draw (146.17bp,71.948bp) node {\Large$\bullet$};
% Edge: f_p!q -> s3
\draw [] (72.5bp,94.988bp) .. controls (72.5bp,84.921bp) and (72.5bp,69.474bp) .. (72.5bp,59.304bp);
% Edge: f_!p -> q4
\draw [] (21.5bp,152.99bp) .. controls (21.5bp,142.92bp) and (21.5bp,127.47bp) .. (21.5bp,117.3bp);
\draw (21.5bp,137.3bp) node {\Large$\bullet$};
% Edge: p0 -> q4
\draw [] (65.409bp,155.21bp) .. controls (55.665bp,144.51bp) and (38.243bp,125.38bp) .. (28.531bp,114.72bp);
\draw (41.998bp,129.51bp) node {\Large$\circ$};
% Edge: p0 -> q1
\draw [] (79.591bp,155.21bp) .. controls (89.335bp,144.51bp) and (106.76bp,125.38bp) .. (116.47bp,114.72bp);
% Edge: q4 -> s3
\draw [] (28.591bp,97.213bp) .. controls (38.335bp,86.514bp) and (55.757bp,67.385bp) .. (65.469bp,56.72bp);
% Edge: q4 -> 4
\draw [] (21.5bp,94.988bp) .. controls (21.5bp,79.384bp) and (21.5bp,50.854bp) .. (21.5bp,49.086bp);
\draw (21.5bp,69.086bp) node {\Large$\bullet$};
% Edge: q1 -> s3
\draw [] (116.41bp,97.213bp) .. controls (106.66bp,86.514bp) and (89.243bp,67.385bp) .. (79.531bp,56.72bp);
\draw (92.998bp,71.507bp) node {\Large$\bullet$};
% Edge: q1 -> r2
\draw [] (124.04bp,94.988bp) .. controls (124.58bp,84.921bp) and (125.4bp,69.474bp) .. (125.95bp,59.304bp);
% Edge: s3 -> 2
\draw [] (71.168bp,36.791bp) .. controls (69.456bp,23.663bp) and (66.68bp,2.3815bp) .. (66.508bp,1.0642bp);
% Edge: s3 -> 3
\draw [] (75.257bp,37.245bp) .. controls (78.954bp,24.164bp) and (85.101bp,2.4123bp) .. (85.481bp,1.0657bp);
\draw (80.042bp,20.312bp) node {\Large$\bullet$};
% Edge: r2 -> 0
\draw [] (123.11bp,37.245bp) .. controls (118.56bp,24.164bp) and (110.99bp,2.4123bp) .. (110.52bp,1.0657bp);
% Edge: r2 -> 1
\draw [] (127.17bp,36.791bp) .. controls (128.02bp,23.663bp) and (129.41bp,2.3815bp) .. (129.5bp,1.0642bp);
\draw (128.19bp,21.022bp) node {\Large$\bullet$};
% Node: f_E
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (94.0bp,233.0bp) -- (51.0bp,233.0bp) -- (51.0bp,211.0bp) -- (94.0bp,211.0bp) -- cycle;
\draw (72.5bp,222.0bp) node {$f$};
\end{scope}
% Node: p0
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (72.5bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (72.5bp,164.0bp) node {$p$};
\end{scope}
% Node: f_p
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (145.0bp,175.0bp) -- (102.0bp,175.0bp) -- (102.0bp,153.0bp) -- (145.0bp,153.0bp) -- cycle;
\draw (123.5bp,164.0bp) node {$f_{p}$};
\end{scope}
% Node: q1
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (123.5bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (123.5bp,106.0bp) node {$q$};
\end{scope}
% Node: f_pq
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (196.0bp,117.0bp) -- (153.0bp,117.0bp) -- (153.0bp,95.0bp) -- (196.0bp,95.0bp) -- cycle;
\draw (174.5bp,106.0bp) node {$f_{pq}$};
\end{scope}
% Node: r2
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (126.5bp,48.0bp) ellipse (11.0bp and 11.0bp);
\draw (126.5bp,48.0bp) node {$r$};
\end{scope}
% Node: f_p!q
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (94.0bp,117.0bp) -- (51.0bp,117.0bp) -- (51.0bp,95.0bp) -- (94.0bp,95.0bp) -- cycle;
\draw (72.5bp,106.0bp) node {$f_{p\lnot q}$};
\end{scope}
% Node: s3
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (72.5bp,48.0bp) ellipse (11.0bp and 11.0bp);
\draw (72.5bp,48.0bp) node {$s$};
\end{scope}
% Node: f_!p
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (43.0bp,175.0bp) -- (0.0bp,175.0bp) -- (0.0bp,153.0bp) -- (43.0bp,153.0bp) -- cycle;
\draw (21.5bp,164.0bp) node {$f_{\lnot p}$};
\end{scope}
% Node: q4
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (21.5bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (21.5bp,106.0bp) node {$q$};
\end{scope}
%
\end{tikzpicture}
}
\end{center}

5
bdds/0015.tex

@ -0,0 +1,5 @@
\item Construct a Reduced Ordered Binary Decision Diagram (ROBDD) for the formula
$$f = (p \lor q) \land (r \lor \lnot s) \land (\lnot p \lor t)$$
using \textit{alphabetic variable order}. Use complemented edges and a node for \texttt{true} as the only constant node. To simplify drawing, you may assume that \textit{dangling edges} point to the constant node. Write down all cofactors that you compute to obtain the final result and mark them in the graph.

184
bdds/0015_sol.tex

@ -0,0 +1,184 @@
\begin{cofactors}
$f$ \= $= (((p \lor q) \land (r \lor \lnot s)) \land (\lnot p \lor t))$\\
\>$f_{p}$ \= $= ((r \lor \lnot s) \land t)$\\
\>\>$f_{pr}$ \= $= t$\\
\>\>\>$f_{prt}$ \= $= \true$\\
\>\>\>$f_{pr\lnot t}$ \= $= \false$\\
\>\>$f_{p\lnot r}$ \= $= (\lnot s \land t)$\\
\>\>\>$f_{p\lnot rs}$ \= $= \false$\\
\>\>\>$f_{p\lnot r\lnot s}$ \= $= f_{pr}$\\
\>$f_{\lnot p}$ \= $= (q \land (r \lor \lnot s))$\\
\>\>$f_{\lnot pq}$ \= $= (r \lor \lnot s)$\\
\>\>\>$f_{\lnot pqr}$ \= $= \true$\\
\>\>\>$f_{\lnot pq\lnot r}$ \= $= \lnot s$\\
\>\>\>\>$f_{\lnot pq\lnot rs}$ \= $= \false$\\
\>\>\>\>$f_{\lnot pq\lnot r\lnot s}$ \= $= \true$\\
\>\>$f_{\lnot p\lnot q}$ \= $= \false$\\
\end{cofactors}
The final ROBDD:
\begin{center}
\scalebox{0.75}{
\begin{tikzpicture}[>=latex,line join=bevel,]
\pgfsetlinewidth{1bp}
%%
\pgfsetcolor{black}
% Edge: f_E -> p0
\draw [] (107.57bp,268.99bp) .. controls (107.57bp,258.92bp) and (107.57bp,243.47bp) .. (107.57bp,233.3bp);
% Edge: f_p -> r1
\draw [] (188.57bp,210.99bp) .. controls (188.57bp,200.92bp) and (188.57bp,185.47bp) .. (188.57bp,175.3bp);
% Edge: f_pr -> t2
\draw [] (231.63bp,94.988bp) .. controls (221.85bp,84.04bp) and (206.4bp,66.729bp) .. (197.5bp,56.763bp);
% Edge: f_p!r -> s3
\draw [] (140.07bp,152.99bp) .. controls (142.62bp,142.8bp) and (146.55bp,127.09bp) .. (149.09bp,116.93bp);
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (144.24bp,136.33bp) node {\Large$\bullet$};
% Edge: f_!p -> q4
\draw [] (23.569bp,210.99bp) .. controls (23.569bp,200.92bp) and (23.569bp,185.47bp) .. (23.569bp,175.3bp);
% Edge: f_!pq -> r5
\draw [] (70.099bp,152.99bp) .. controls (65.493bp,142.67bp) and (58.363bp,126.7bp) .. (53.833bp,116.55bp);
% Edge: f_!pq!r -> s6
\draw [] (98.781bp,94.988bp) .. controls (96.961bp,84.795bp) and (94.156bp,69.087bp) .. (92.341bp,58.925bp);
\draw (95.857bp,78.614bp) node {\Large$\bullet$};
% Edge: p0 -> q4
\draw [] (98.896bp,215.22bp) .. controls (82.799bp,204.49bp) and (48.476bp,181.6bp) .. (32.321bp,170.83bp);
\draw (48.962bp,181.93bp) node {\Large$\circ$};
% Edge: p0 -> r1
\draw [] (116.24bp,215.01bp) .. controls (131.75bp,204.29bp) and (164.08bp,181.93bp) .. (179.72bp,171.12bp);
% Edge: q4 -> r5
\draw [] (27.862bp,153.75bp) .. controls (32.651bp,143.44bp) and (40.356bp,126.84bp) .. (45.182bp,116.45bp);
% Edge: q4 -> 6
\draw [] (22.854bp,152.99bp) .. controls (21.739bp,137.38bp) and (19.701bp,108.85bp) .. (19.575bp,107.09bp);
\draw (21.0bp,127.04bp) node {\Large$\bullet$};
% Edge: r5 -> s6
\draw [] (55.619bp,96.737bp) .. controls (63.37bp,86.149bp) and (76.731bp,67.901bp) .. (84.494bp,57.297bp);
\draw (72.68bp,73.434bp) node {\Large$\bullet$};
% Edge: r5 -> 3
\draw [] (49.569bp,94.988bp) .. controls (49.569bp,79.384bp) and (49.569bp,50.854bp) .. (49.569bp,49.086bp);
% Edge: s6 -> 4
\draw [] (88.35bp,36.791bp) .. controls (85.496bp,23.663bp) and (80.869bp,2.3815bp) .. (80.583bp,1.0642bp);
% Edge: s6 -> 5
\draw [] (92.566bp,36.791bp) .. controls (95.135bp,23.663bp) and (99.299bp,2.3815bp) .. (99.556bp,1.0642bp);
\draw (95.716bp,20.692bp) node {\Large$\bullet$};
% Edge: r1 -> s3
\draw [] (182.79bp,154.25bp) .. controls (175.8bp,143.67bp) and (164.11bp,125.98bp) .. (157.19bp,115.51bp);
\draw (168.21bp,132.19bp) node {\Large$\bullet$};
% Edge: r1 -> t2
\draw [] (188.75bp,152.88bp) .. controls (189.12bp,131.3bp) and (190.01bp,80.962bp) .. (190.39bp,59.258bp);
% Edge: s3 -> t2
\draw [] (157.66bp,96.25bp) .. controls (165.03bp,85.668bp) and (177.35bp,67.976bp) .. (184.65bp,57.505bp);
\draw (173.22bp,73.917bp) node {\Large$\bullet$};
% Edge: s3 -> 2
\draw [] (151.57bp,94.988bp) .. controls (151.57bp,79.384bp) and (151.57bp,50.854bp) .. (151.57bp,49.086bp);
% Edge: t2 -> 0
\draw [] (188.35bp,36.791bp) .. controls (185.5bp,23.663bp) and (180.87bp,2.3815bp) .. (180.58bp,1.0642bp);
% Edge: t2 -> 1
\draw [] (192.57bp,36.791bp) .. controls (195.13bp,23.663bp) and (199.3bp,2.3815bp) .. (199.56bp,1.0642bp);
\draw (195.72bp,20.692bp) node {\Large$\bullet$};
% Node: f_E
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (129.07bp,291.0bp) -- (86.07bp,291.0bp) -- (86.07bp,269.0bp) -- (129.07bp,269.0bp) -- cycle;
\draw (107.57bp,280.0bp) node {$f$};
\end{scope}
% Node: p0
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (107.57bp,222.0bp) ellipse (11.0bp and 11.0bp);
\draw (107.57bp,222.0bp) node {$p$};
\end{scope}
% Node: f_p
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (210.07bp,233.0bp) -- (167.07bp,233.0bp) -- (167.07bp,211.0bp) -- (210.07bp,211.0bp) -- cycle;
\draw (188.57bp,222.0bp) node {$f_{p}$};
\end{scope}
% Node: r1
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (188.57bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (188.57bp,164.0bp) node {$r$};
\end{scope}
% Node: f_pr
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (262.07bp,117.0bp) -- (219.07bp,117.0bp) -- (219.07bp,95.0bp) -- (262.07bp,95.0bp) -- cycle;
\draw (240.57bp,106.0bp) node {$f_{pr}$};
\end{scope}
% Node: t2
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (190.57bp,48.0bp) ellipse (11.0bp and 11.0bp);
\draw (190.57bp,48.0bp) node {$t$};
\end{scope}
% Node: f_p!r
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (159.07bp,175.0bp) -- (116.07bp,175.0bp) -- (116.07bp,153.0bp) -- (159.07bp,153.0bp) -- cycle;
\draw (137.57bp,164.0bp) node {$f_{p\lnot r}$};
\end{scope}
% Node: s3
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (151.57bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (151.57bp,106.0bp) node {$s$};
\end{scope}
% Node: f_!p
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (45.07bp,233.0bp) -- (2.07bp,233.0bp) -- (2.07bp,211.0bp) -- (45.07bp,211.0bp) -- cycle;
\draw (23.569bp,222.0bp) node {$f_{\lnot p}$};
\end{scope}
% Node: q4
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (23.57bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (23.569bp,164.0bp) node {$q$};
\end{scope}
% Node: f_!pq
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (96.07bp,175.0bp) -- (53.07bp,175.0bp) -- (53.07bp,153.0bp) -- (96.07bp,153.0bp) -- cycle;
\draw (74.569bp,164.0bp) node {$f_{\lnot pq}$};
\end{scope}
% Node: r5
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (49.57bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (49.569bp,106.0bp) node {$r$};
\end{scope}
% Node: f_!pq!r
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (122.07bp,117.0bp) -- (79.07bp,117.0bp) -- (79.07bp,95.0bp) -- (122.07bp,95.0bp) -- cycle;
\draw (100.57bp,106.0bp) node {$f_{\lnot pq\lnot r}$};
\end{scope}
% Node: s6
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (90.57bp,48.0bp) ellipse (11.0bp and 11.0bp);
\draw (90.569bp,48.0bp) node {$s$};
\end{scope}
%
\end{tikzpicture}
}
\end{center}

5
bdds/0016.tex

@ -0,0 +1,5 @@
\item Construct a Reduced Ordered Binary Decision Diagram (ROBDD) for the formula
$$f = (a \land b) \lor (\lnot c \land d) \lor (e \land \lnot a)$$
using \textit{alphabetic variable order}. Use complemented edges and a node for \texttt{true} as the only constant node. To simplify drawing, you may assume that \textit{dangling edges} point to the constant node. Write down all cofactors that you compute to obtain the final result and mark them in the graph.

183
bdds/0016_sol.tex

@ -0,0 +1,183 @@
\begin{cofactors}
$f$ \= $= (((a \land b) \lor (\lnot c \land d)) \lor (e \land \lnot a))$\\
\>$f_{a}$ \= $= (b \lor (\lnot c \land d))$\\
\>\>$f_{ab}$ \= $= \true$\\
\>\>$f_{a\lnot b}$ \= $= (\lnot c \land d)$\\
\>\>\>$f_{a\lnot bc}$ \= $= \false$\\
\>\>\>$f_{a\lnot b\lnot c}$ \= $= d$\\
\>\>\>\>$f_{a\lnot b\lnot cd}$ \= $= \true$\\
\>\>\>\>$f_{a\lnot b\lnot c\lnot d}$ \= $= \false$\\
\>$f_{\lnot a}$ \= $= ((\lnot c \land d) \lor e)$\\
\>\>$f_{\lnot ac}$ \= $= e$\\
\>\>\>$f_{\lnot ace}$ \= $= \true$\\
\>\>\>$f_{\lnot ac\lnot e}$ \= $= \false$\\
\>\>$f_{\lnot a\lnot c}$ \= $= (d \lor e)$\\
\>\>\>$f_{\lnot a\lnot cd}$ \= $= \true$\\
\>\>\>$f_{\lnot a\lnot c\lnot d}$ \= $= f_{\lnot ac}$\\
\end{cofactors}
The final ROBDD:
\begin{center}
\scalebox{0.75}{
\begin{tikzpicture}[>=latex,line join=bevel,]
\pgfsetlinewidth{1bp}
%%
\pgfsetcolor{black}
% Edge: f_E -> a0
\draw [] (84.143bp,268.99bp) .. controls (84.143bp,258.92bp) and (84.143bp,243.47bp) .. (84.143bp,233.3bp);
% Edge: f_a -> b1
\draw [] (135.14bp,210.99bp) .. controls (135.14bp,200.92bp) and (135.14bp,185.47bp) .. (135.14bp,175.3bp);
% Edge: f_a!b -> c2
\draw [] (184.35bp,152.99bp) .. controls (182.53bp,142.8bp) and (179.73bp,127.09bp) .. (177.91bp,116.93bp);
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (181.43bp,136.61bp) node {\Large$\bullet$};
% Edge: f_a!b!c -> d3
\draw [] (225.18bp,94.988bp) .. controls (223.17bp,84.795bp) and (220.09bp,69.087bp) .. (218.09bp,58.925bp);
% Edge: f_!a -> c4
\draw [] (33.143bp,210.99bp) .. controls (33.143bp,200.92bp) and (33.143bp,185.47bp) .. (33.143bp,175.3bp);
% Edge: f_!ac -> e5
\draw [] (33.143bp,94.988bp) .. controls (33.143bp,84.921bp) and (33.143bp,69.474bp) .. (33.143bp,59.304bp);
% Edge: f_!a!c -> d6
\draw [] (84.143bp,152.99bp) .. controls (84.143bp,142.92bp) and (84.143bp,127.47bp) .. (84.143bp,117.3bp);
% Edge: a0 -> c4
\draw [] (77.051bp,213.21bp) .. controls (67.308bp,202.51bp) and (49.886bp,183.38bp) .. (40.174bp,172.72bp);
\draw (53.64bp,187.51bp) node {\Large$\circ$};
% Edge: a0 -> b1
\draw [] (91.234bp,213.21bp) .. controls (100.98bp,202.51bp) and (118.4bp,183.38bp) .. (128.11bp,172.72bp);
% Edge: c4 -> d6
\draw [] (40.234bp,155.21bp) .. controls (49.978bp,144.51bp) and (67.4bp,125.38bp) .. (77.112bp,114.72bp);
\draw (63.645bp,129.51bp) node {\Large$\circ$};
% Edge: c4 -> e5
\draw [] (25.797bp,155.3bp) .. controls (18.182bp,146.73bp) and (6.7572bp,132.1bp) .. (2.1426bp,117.0bp) .. controls (-0.71421bp,107.65bp) and (-0.71421bp,104.35bp) .. (2.1426bp,95.0bp) .. controls (6.7572bp,79.895bp) and (18.182bp,65.265bp) .. (25.797bp,56.7bp);
% Edge: d6 -> e5
\draw [] (77.051bp,97.213bp) .. controls (67.308bp,86.514bp) and (49.886bp,67.385bp) .. (40.174bp,56.72bp);
\draw (53.64bp,71.507bp) node {\Large$\circ$};
% Edge: d6 -> 6
\draw [] (84.143bp,94.988bp) .. controls (84.143bp,79.384bp) and (84.143bp,50.854bp) .. (84.143bp,49.086bp);
% Edge: e5 -> 4
\draw [] (31.145bp,36.791bp) .. controls (28.577bp,23.663bp) and (24.413bp,2.3815bp) .. (24.155bp,1.0642bp);
% Edge: e5 -> 5
\draw [] (35.362bp,36.791bp) .. controls (38.216bp,23.663bp) and (42.842bp,2.3815bp) .. (43.129bp,1.0642bp);
\draw (38.88bp,20.608bp) node {\Large$\bullet$};
% Edge: b1 -> c2
\draw [] (141.19bp,154.74bp) .. controls (148.94bp,144.15bp) and (162.3bp,125.9bp) .. (170.07bp,115.3bp);
\draw (158.25bp,131.43bp) node {\Large$\bullet$};
% Edge: b1 -> 0
\draw [] (135.14bp,152.99bp) .. controls (135.14bp,137.38bp) and (135.14bp,108.85bp) .. (135.14bp,107.09bp);
% Edge: c2 -> d3
\draw [] (182.39bp,96.25bp) .. controls (189.95bp,85.668bp) and (202.59bp,67.976bp) .. (210.07bp,57.505bp);
\draw (198.44bp,73.78bp) node {\Large$\bullet$};
% Edge: c2 -> 1
\draw [] (176.14bp,94.988bp) .. controls (176.14bp,79.384bp) and (176.14bp,50.854bp) .. (176.14bp,49.086bp);
% Edge: d3 -> 2
\draw [] (213.92bp,36.791bp) .. controls (211.07bp,23.663bp) and (206.44bp,2.3815bp) .. (206.16bp,1.0642bp);
% Edge: d3 -> 3
\draw [] (218.14bp,36.791bp) .. controls (220.71bp,23.663bp) and (224.87bp,2.3815bp) .. (225.13bp,1.0642bp);
\draw (221.29bp,20.692bp) node {\Large$\bullet$};
% Node: f_E
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (105.64bp,291.0bp) -- (62.64bp,291.0bp) -- (62.64bp,269.0bp) -- (105.64bp,269.0bp) -- cycle;
\draw (84.143bp,280.0bp) node {$f$};
\end{scope}
% Node: a0
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (84.14bp,222.0bp) ellipse (11.0bp and 11.0bp);
\draw (84.143bp,222.0bp) node {$a$};
\end{scope}
% Node: f_a
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (156.64bp,233.0bp) -- (113.64bp,233.0bp) -- (113.64bp,211.0bp) -- (156.64bp,211.0bp) -- cycle;
\draw (135.14bp,222.0bp) node {$f_{a}$};
\end{scope}
% Node: b1
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (135.14bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (135.14bp,164.0bp) node {$b$};
\end{scope}
% Node: f_a!b
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (207.64bp,175.0bp) -- (164.64bp,175.0bp) -- (164.64bp,153.0bp) -- (207.64bp,153.0bp) -- cycle;
\draw (186.14bp,164.0bp) node {$f_{a\lnot b}$};
\end{scope}
% Node: c2
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (176.14bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (176.14bp,106.0bp) node {$c$};
\end{scope}
% Node: f_a!b!c
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (248.64bp,117.0bp) -- (205.64bp,117.0bp) -- (205.64bp,95.0bp) -- (248.64bp,95.0bp) -- cycle;
\draw (227.14bp,106.0bp) node {$f_{a\lnot b\lnot c}$};
\end{scope}
% Node: d3
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (216.14bp,48.0bp) ellipse (11.0bp and 11.0bp);
\draw (216.14bp,48.0bp) node {$d$};
\end{scope}
% Node: f_!a
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (54.64bp,233.0bp) -- (11.64bp,233.0bp) -- (11.64bp,211.0bp) -- (54.64bp,211.0bp) -- cycle;
\draw (33.143bp,222.0bp) node {$f_{\lnot a}$};
\end{scope}
% Node: c4
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (33.14bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (33.143bp,164.0bp) node {$c$};
\end{scope}
% Node: f_!ac
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (54.64bp,117.0bp) -- (11.64bp,117.0bp) -- (11.64bp,95.0bp) -- (54.64bp,95.0bp) -- cycle;
\draw (33.143bp,106.0bp) node {$f_{\lnot ac}$};
\end{scope}
% Node: e5
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (33.14bp,48.0bp) ellipse (11.0bp and 11.0bp);
\draw (33.143bp,48.0bp) node {$e$};
\end{scope}
% Node: f_!a!c
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (105.64bp,175.0bp) -- (62.64bp,175.0bp) -- (62.64bp,153.0bp) -- (105.64bp,153.0bp) -- cycle;
\draw (84.143bp,164.0bp) node {$f_{\lnot a\lnot c}$};
\end{scope}
% Node: d6
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (84.14bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (84.143bp,106.0bp) node {$d$};
\end{scope}
%
\end{tikzpicture}
}
\end{center}

5
bdds/0017.tex

@ -0,0 +1,5 @@
\item Construct a Reduced Ordered Binary Decision Diagram (ROBDD) for the formula
$$f = (a \land b) \lor (\lnot c \land d) \lor (e \land \lnot a)$$
using \textit{reverse alphabetic variable order}. Use complemented edges and a node for \texttt{true} as the only constant node. To simplify drawing, you may assume that \textit{dangling edges} point to the constant node. Write down all cofactors that you compute to obtain the final result and mark them in the graph.

206
bdds/0017_sol.tex

@ -0,0 +1,206 @@
\begin{cofactors}
$f$ \= $= (((a \land b) \lor (\lnot c \land d)) \lor (e \land \lnot a))$\\
\>$f_{e}$ \= $= (((a \land b) \lor (\lnot c \land d)) \lor \lnot a)$\\
\>\>$f_{ed}$ \= $= (((a \land b) \lor \lnot c) \lor \lnot a)$\\
\>\>\>$f_{edc}$ \= $= ((a \land b) \lor \lnot a)$\\
\>\>\>\>$f_{edcb}$ \= $= \true$\\
\>\>\>\>$f_{edc\lnot b}$ \= $= \lnot a$\\
\>\>\>\>\>$f_{edc\lnot ba}$ \= $= \false$\\
\>\>\>\>\>$f_{edc\lnot b\lnot a}$ \= $= \true$\\
\>\>\>$f_{ed\lnot c}$ \= $= \true$\\
\>\>$f_{e\lnot d}$ \= $= f_{edc}$\\
\>$f_{\lnot e}$ \= $= ((a \land b) \lor (\lnot c \land d))$\\
\>\>$f_{\lnot ed}$ \= $= ((a \land b) \lor \lnot c)$\\
\>\>\>$f_{\lnot edc}$ \= $= (a \land b)$\\
\>\>\>\>$f_{\lnot edcb}$ \= $= \lnot f_{edc\lnot b}$\\
\>\>\>\>$f_{\lnot edc\lnot b}$ \= $= \false$\\
\>\>\>$f_{\lnot ed\lnot c}$ \= $= \true$\\
\>\>$f_{\lnot e\lnot d}$ \= $= f_{\lnot edc}$\\
\end{cofactors}
The final ROBDD:
\begin{center}
\scalebox{0.75}{
\begin{tikzpicture}[>=latex,line join=bevel,]
\pgfsetlinewidth{1bp}
%%
\pgfsetcolor{black}
% Edge: f_E -> e0
\draw [] (114.56bp,326.99bp) .. controls (114.56bp,316.92bp) and (114.56bp,301.47bp) .. (114.56bp,291.3bp);
% Edge: f_e -> d1
\draw [] (195.56bp,268.99bp) .. controls (195.56bp,258.92bp) and (195.56bp,243.47bp) .. (195.56bp,233.3bp);
% Edge: f_ed -> c2
\draw [] (145.63bp,210.99bp) .. controls (146.71bp,200.92bp) and (148.37bp,185.47bp) .. (149.46bp,175.3bp);
% Edge: f_edc -> b3
\draw [] (236.62bp,152.99bp) .. controls (226.85bp,142.04bp) and (211.39bp,124.73bp) .. (202.49bp,114.76bp);
% Edge: f_edc!b -> a4
\draw [] (144.56bp,94.988bp) .. controls (144.56bp,84.921bp) and (144.56bp,69.474bp) .. (144.56bp,59.304bp);
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (144.56bp,79.304bp) node {\Large$\bullet$};
% Edge: f_!e -> d5
\draw [] (32.561bp,268.99bp) .. controls (32.561bp,258.92bp) and (32.561bp,243.47bp) .. (32.561bp,233.3bp);
% Edge: f_!ed -> c6
\draw [] (83.74bp,210.99bp) .. controls (83.92bp,200.92bp) and (84.196bp,185.47bp) .. (84.377bp,175.3bp);
% Edge: f_!edc -> b7
\draw [] (35.528bp,152.99bp) .. controls (37.53bp,142.8bp) and (40.616bp,127.09bp) .. (42.612bp,116.93bp);
% Edge: e0 -> d5
\draw [] (105.79bp,273.01bp) .. controls (90.003bp,262.23bp) and (57.01bp,239.7bp) .. (41.274bp,228.95bp);
\draw (57.79bp,240.23bp) node {\Large$\circ$};
% Edge: e0 -> d1
\draw [] (123.23bp,273.01bp) .. controls (138.74bp,262.29bp) and (171.07bp,239.93bp) .. (186.71bp,229.12bp);
% Edge: d5 -> c6
\draw [] (39.792bp,213.21bp) .. controls (49.726bp,202.51bp) and (67.49bp,183.38bp) .. (77.392bp,172.72bp);
% Edge: d5 -> b7
\draw [] (25.112bp,213.55bp) .. controls (13.652bp,201.13bp) and (-6.1173bp,175.38bp) .. (2.5613bp,153.0bp) .. controls (9.2091bp,135.86bp) and (25.549bp,121.2bp) .. (35.777bp,113.28bp);
\draw (20.122bp,125.73bp) node {\Large$\circ$};
% Edge: c6 -> b7
\draw [] (78.311bp,154.25bp) .. controls (70.753bp,143.67bp) and (58.116bp,125.98bp) .. (50.636bp,115.51bp);
% Edge: c6 -> 5
\draw [] (84.561bp,152.99bp) .. controls (84.561bp,137.38bp) and (84.561bp,108.85bp) .. (84.561bp,107.09bp);
\draw (84.561bp,127.09bp) node {\Large$\circ$};
% Edge: b7 -> a4
\draw [] (53.79bp,99.832bp) .. controls (72.84bp,89.164bp) and (116.32bp,64.813bp) .. (135.36bp,54.155bp);
% Edge: b7 -> 4
\draw [] (44.561bp,94.988bp) .. controls (44.561bp,79.384bp) and (44.561bp,50.854bp) .. (44.561bp,49.086bp);
\draw (44.561bp,69.086bp) node {\Large$\bullet$};
% Edge: d1 -> c2
\draw [] (188.92bp,212.74bp) .. controls (180.41bp,202.15bp) and (165.75bp,183.9bp) .. (157.23bp,173.3bp);
% Edge: d1 -> b3
\draw [] (195.56bp,210.88bp) .. controls (195.56bp,189.3bp) and (195.56bp,138.96bp) .. (195.56bp,117.26bp);
\draw (195.56bp,137.26bp) node {\Large$\circ$};
% Edge: c2 -> b3
\draw [] (157.2bp,154.74bp) .. controls (165.71bp,144.15bp) and (180.37bp,125.9bp) .. (188.89bp,115.3bp);
% Edge: c2 -> 3
\draw [] (143.77bp,154.74bp) .. controls (131.38bp,139.65bp) and (106.2bp,108.99bp) .. (104.64bp,107.09bp);
\draw (117.33bp,122.55bp) node {\Large$\circ$};
% Edge: b3 -> a4
\draw [] (188.47bp,97.213bp) .. controls (178.73bp,86.514bp) and (161.3bp,67.385bp) .. (151.59bp,56.72bp);
\draw (165.06bp,71.507bp) node {\Large$\bullet$};
% Edge: b3 -> 0
\draw [] (195.56bp,94.988bp) .. controls (195.56bp,79.384bp) and (195.56bp,50.854bp) .. (195.56bp,49.086bp);
% Edge: a4 -> 1
\draw [] (142.56bp,36.791bp) .. controls (140.0bp,23.663bp) and (135.83bp,2.3815bp) .. (135.57bp,1.0642bp);
% Edge: a4 -> 2
\draw [] (146.78bp,36.791bp) .. controls (149.63bp,23.663bp) and (154.26bp,2.3815bp) .. (154.55bp,1.0642bp);
\draw (150.3bp,20.608bp) node {\Large$\bullet$};
% Node: f_E
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (136.06bp,349.0bp) -- (93.06bp,349.0bp) -- (93.06bp,327.0bp) -- (136.06bp,327.0bp) -- cycle;
\draw (114.56bp,338.0bp) node {$f$};
\end{scope}
% Node: e0
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (114.56bp,280.0bp) ellipse (11.0bp and 11.0bp);
\draw (114.56bp,280.0bp) node {$e$};
\end{scope}
% Node: f_e
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (217.06bp,291.0bp) -- (174.06bp,291.0bp) -- (174.06bp,269.0bp) -- (217.06bp,269.0bp) -- cycle;
\draw (195.56bp,280.0bp) node {$f_{e}$};
\end{scope}
% Node: d1
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (195.56bp,222.0bp) ellipse (11.0bp and 11.0bp);
\draw (195.56bp,222.0bp) node {$d$};
\end{scope}
% Node: f_ed
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (166.06bp,233.0bp) -- (123.06bp,233.0bp) -- (123.06bp,211.0bp) -- (166.06bp,211.0bp) -- cycle;
\draw (144.56bp,222.0bp) node {$f_{ed}$};
\end{scope}
% Node: c2
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (150.56bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (150.56bp,164.0bp) node {$c$};
\end{scope}
% Node: f_edc
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (267.06bp,175.0bp) -- (224.06bp,175.0bp) -- (224.06bp,153.0bp) -- (267.06bp,153.0bp) -- cycle;
\draw (245.56bp,164.0bp) node {$f_{edc}$};
\end{scope}
% Node: b3
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (195.56bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (195.56bp,106.0bp) node {$b$};
\end{scope}
% Node: f_edc!b
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (166.06bp,117.0bp) -- (123.06bp,117.0bp) -- (123.06bp,95.0bp) -- (166.06bp,95.0bp) -- cycle;
\draw (144.56bp,106.0bp) node {$f_{edc\lnot b}$};
\end{scope}
% Node: a4
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (144.56bp,48.0bp) ellipse (11.0bp and 11.0bp);
\draw (144.56bp,48.0bp) node {$a$};
\end{scope}
% Node: f_!e
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (54.06bp,291.0bp) -- (11.06bp,291.0bp) -- (11.06bp,269.0bp) -- (54.06bp,269.0bp) -- cycle;
\draw (32.561bp,280.0bp) node {$f_{\lnot e}$};
\end{scope}
% Node: d5
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (32.56bp,222.0bp) ellipse (11.0bp and 11.0bp);
\draw (32.561bp,222.0bp) node {$d$};
\end{scope}
% Node: f_!ed
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (105.06bp,233.0bp) -- (62.06bp,233.0bp) -- (62.06bp,211.0bp) -- (105.06bp,211.0bp) -- cycle;
\draw (83.561bp,222.0bp) node {$f_{\lnot ed}$};
\end{scope}
% Node: c6
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (84.56bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (84.561bp,164.0bp) node {$c$};
\end{scope}
% Node: f_!edc
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (55.06bp,175.0bp) -- (12.06bp,175.0bp) -- (12.06bp,153.0bp) -- (55.06bp,153.0bp) -- cycle;
\draw (33.561bp,164.0bp) node {$f_{\lnot edc}$};
\end{scope}
% Node: b7
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (44.56bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (44.561bp,106.0bp) node {$b$};
\end{scope}
%
\end{tikzpicture}
}
\end{center}

5
bdds/0018.tex

@ -0,0 +1,5 @@
\item Construct a Reduced Ordered Binary Decision Diagram (ROBDD) for the formula
$$f = (p \land q) \lor (r \land s) \lor (\lnot p \land \lnot r)$$
using \textit{reverse alphabetic variable order}. Use complemented edges and a node for \texttt{true} as the only constant node. To simplify drawing, you may assume that \textit{dangling edges} point to the constant node. Write down all cofactors that you compute to obtain the final result and mark them in the graph.

160
bdds/0018_sol.tex

@ -0,0 +1,160 @@
\begin{cofactors}
$f$ \= $= (((p \land q) \lor (r \land s)) \lor (\lnot p \land \lnot r))$\\
\>$f_{s}$ \= $= (((p \land q) \lor r) \lor (\lnot p \land \lnot r))$\\
\>\>$f_{sr}$ \= $= \true$\\
\>\>$f_{s\lnot r}$ \= $= ((p \land q) \lor \lnot p)$\\
\>\>\>$f_{s\lnot rq}$ \= $= \true$\\
\>\>\>$f_{s\lnot r\lnot q}$ \= $= \lnot p$\\
\>\>\>\>$f_{s\lnot r\lnot qp}$ \= $= \false$\\
\>\>\>\>$f_{s\lnot r\lnot q\lnot p}$ \= $= \true$\\
\>$f_{\lnot s}$ \= $= ((p \land q) \lor (\lnot p \land \lnot r))$\\
\>\>$f_{\lnot sr}$ \= $= (p \land q)$\\
\>\>\>$f_{\lnot srq}$ \= $= \lnot f_{s\lnot r\lnot q}$\\
\>\>\>$f_{\lnot sr\lnot q}$ \= $= \false$\\
\>\>$f_{\lnot s\lnot r}$ \= $= f_{s\lnot r}$\\
\end{cofactors}
The final ROBDD:
\begin{center}
\scalebox{0.75}{
\begin{tikzpicture}[>=latex,line join=bevel,]
\pgfsetlinewidth{1bp}
%%
\pgfsetcolor{black}
% Edge: f_E -> s0
\draw [] (123.5bp,268.99bp) .. controls (123.5bp,258.92bp) and (123.5bp,243.47bp) .. (123.5bp,233.3bp);
% Edge: f_s -> r1
\draw [] (174.5bp,210.99bp) .. controls (174.5bp,200.92bp) and (174.5bp,185.47bp) .. (174.5bp,175.3bp);
% Edge: f_s!r -> q2
\draw [] (123.5bp,152.99bp) .. controls (123.5bp,142.92bp) and (123.5bp,127.47bp) .. (123.5bp,117.3bp);
% Edge: f_s!r!q -> p3
\draw [] (72.5bp,94.988bp) .. controls (72.5bp,84.921bp) and (72.5bp,69.474bp) .. (72.5bp,59.304bp);
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (72.5bp,79.304bp) node {\Large$\bullet$};
% Edge: f_!s -> r4
\draw [] (72.5bp,210.99bp) .. controls (72.5bp,200.92bp) and (72.5bp,185.47bp) .. (72.5bp,175.3bp);
% Edge: f_!sr -> q5
\draw [] (21.5bp,152.99bp) .. controls (21.5bp,142.92bp) and (21.5bp,127.47bp) .. (21.5bp,117.3bp);
% Edge: s0 -> r4
\draw [] (116.41bp,213.21bp) .. controls (106.66bp,202.51bp) and (89.243bp,183.38bp) .. (79.531bp,172.72bp);
\draw (92.998bp,187.51bp) node {\Large$\circ$};
% Edge: s0 -> r1
\draw [] (130.59bp,213.21bp) .. controls (140.34bp,202.51bp) and (157.76bp,183.38bp) .. (167.47bp,172.72bp);
% Edge: r4 -> q5
\draw [] (65.409bp,155.21bp) .. controls (55.665bp,144.51bp) and (38.243bp,125.38bp) .. (28.531bp,114.72bp);
% Edge: r4 -> q2
\draw [] (79.591bp,155.21bp) .. controls (89.335bp,144.51bp) and (106.76bp,125.38bp) .. (116.47bp,114.72bp);
\draw (103.0bp,129.51bp) node {\Large$\circ$};
% Edge: q5 -> p3
\draw [] (28.591bp,97.213bp) .. controls (38.335bp,86.514bp) and (55.757bp,67.385bp) .. (65.469bp,56.72bp);
% Edge: q5 -> 4
\draw [] (21.5bp,94.988bp) .. controls (21.5bp,79.384bp) and (21.5bp,50.854bp) .. (21.5bp,49.086bp);
\draw (21.5bp,69.086bp) node {\Large$\bullet$};
% Edge: r1 -> q2
\draw [] (167.41bp,155.21bp) .. controls (157.66bp,144.51bp) and (140.24bp,125.38bp) .. (130.53bp,114.72bp);
\draw (144.0bp,129.51bp) node {\Large$\circ$};
% Edge: r1 -> 0
\draw [] (174.5bp,152.99bp) .. controls (174.5bp,137.38bp) and (174.5bp,108.85bp) .. (174.5bp,107.09bp);
% Edge: q2 -> p3
\draw [] (116.41bp,97.213bp) .. controls (106.66bp,86.514bp) and (89.243bp,67.385bp) .. (79.531bp,56.72bp);
\draw (92.998bp,71.507bp) node {\Large$\bullet$};
% Edge: q2 -> 1
\draw [] (123.5bp,94.988bp) .. controls (123.5bp,79.384bp) and (123.5bp,50.854bp) .. (123.5bp,49.086bp);
% Edge: p3 -> 2
\draw [] (70.281bp,36.791bp) .. controls (67.427bp,23.663bp) and (62.8bp,2.3815bp) .. (62.514bp,1.0642bp);
% Edge: p3 -> 3
\draw [] (74.497bp,36.791bp) .. controls (77.066bp,23.663bp) and (81.23bp,2.3815bp) .. (81.487bp,1.0642bp);
\draw (77.647bp,20.692bp) node {\Large$\bullet$};
% Node: f_E
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (145.0bp,291.0bp) -- (102.0bp,291.0bp) -- (102.0bp,269.0bp) -- (145.0bp,269.0bp) -- cycle;
\draw (123.5bp,280.0bp) node {$f$};
\end{scope}
% Node: s0
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (123.5bp,222.0bp) ellipse (11.0bp and 11.0bp);
\draw (123.5bp,222.0bp) node {$s$};
\end{scope}
% Node: f_s
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (196.0bp,233.0bp) -- (153.0bp,233.0bp) -- (153.0bp,211.0bp) -- (196.0bp,211.0bp) -- cycle;
\draw (174.5bp,222.0bp) node {$f_{s}$};
\end{scope}
% Node: r1
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (174.5bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (174.5bp,164.0bp) node {$r$};
\end{scope}
% Node: f_s!r
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (145.0bp,175.0bp) -- (102.0bp,175.0bp) -- (102.0bp,153.0bp) -- (145.0bp,153.0bp) -- cycle;
\draw (123.5bp,164.0bp) node {$f_{s\lnot r}$};
\end{scope}
% Node: q2
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (123.5bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (123.5bp,106.0bp) node {$q$};
\end{scope}
% Node: f_s!r!q
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (94.0bp,117.0bp) -- (51.0bp,117.0bp) -- (51.0bp,95.0bp) -- (94.0bp,95.0bp) -- cycle;
\draw (72.5bp,106.0bp) node {$f_{s\lnot r\lnot q}$};
\end{scope}
% Node: p3
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (72.5bp,48.0bp) ellipse (11.0bp and 11.0bp);
\draw (72.5bp,48.0bp) node {$p$};
\end{scope}
% Node: f_!s
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (94.0bp,233.0bp) -- (51.0bp,233.0bp) -- (51.0bp,211.0bp) -- (94.0bp,211.0bp) -- cycle;
\draw (72.5bp,222.0bp) node {$f_{\lnot s}$};
\end{scope}
% Node: r4
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (72.5bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (72.5bp,164.0bp) node {$r$};
\end{scope}
% Node: f_!sr
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (43.0bp,175.0bp) -- (0.0bp,175.0bp) -- (0.0bp,153.0bp) -- (43.0bp,153.0bp) -- cycle;
\draw (21.5bp,164.0bp) node {$f_{\lnot sr}$};
\end{scope}
% Node: q5
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (21.5bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (21.5bp,106.0bp) node {$q$};
\end{scope}
%
\end{tikzpicture}
}
\end{center}

4
bdds/1005.tex

@ -0,0 +1,4 @@
\item
What is the worst-case size of a binary decision diagram?
What is the advantage of computing a reduced and ordered BDD to represent a formula compared to using a truth table?

10
bdds/1006.tex

@ -0,0 +1,10 @@
\item How many nodes does a \textit{Reduced Ordered Binary Decision Diagrams (ROBDDs)} for a Boolean formula with $n$ variables have, in worst-case?
\begin{itemize}
\item[$\square$] $2n$
\item[$\square$] $\mathcal{O}(n^2)$
\item[$\square$] $\mathcal{O}(2^n)$
\item[$\square$] $2^{n+1}-1$
\item[$\square$] $n^2$
\item[$\square$] infinitely many
\end{itemize}

9
bdds/1008.tex

@ -0,0 +1,9 @@
\item \self Tick all properties that apply to a reduced and ordered binary decision diagram.
\begin{itemize}
\item[$\square$] A reduced and ordered BDD is a canonical representation of the formula it represents, for any fixed variable order.
\item[$\square$] Since it is reduced, the number of nodes in the reduced and ordered BDD does not exceed $2n^2$, where $n$ is the number of variables.
\item[$\square$] The graph of an BDD may contain cycles.
\item[$\square$] A BDD represents a propositional formula as directed acyclic graph (DAG).
\item[$\square$] Every node with two non-complemented outgoing edges has two distinct child nodes.
\item[$\square$] No two nodes in an reduced and ordered BDD represent the same cofactor.
\end{itemize}

1
bdds/1009.tex

@ -0,0 +1 @@
\item Given you have computed the reduced and ordered BDD for a formula $f$. How can you compute the BDD representation for $\neg f$ in \textit{constant} time?

1
bdds/1010.tex

@ -0,0 +1 @@
\item How can you compute the propositional formula $f$ represented by a given BDD?

1
bdds/1011.tex

@ -0,0 +1 @@
\item Give the definition of redundant nodes in a BDD. Give an example for a BDD that contains at least one redundant node.

29
bdds/1012.tex

@ -0,0 +1,29 @@
\item \BDDToROBDD
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=2mm,
l sep=2mm}
[$f$, rectangle, draw, tikz={\draw [line] () to (a.north);}
[$a$, name=a, tikz={\draw [line] () to (b1.north east); \draw [dot=.5] () to (b2.north west);}
[$b$, name=b1, tikz={\draw [line] () to (c1.north); \draw [dot=.5] () to (c2.north);}
[$c$, name=c1, tikz={\draw [line, bend right] () to (one.west); \draw [dot=.5, bend right] () to (zero.west);}]
[$c$, l sep=15mm, name=c2, tikz={\draw [line, bend right] () to (one.north); \draw [dot=.5, bend left] () to (one.north east);}
[$1$, rectangle, draw, name=one]
[,phantom]
]
]
[$b$, name=b2, tikz={\draw [line] () to (c3.north); \draw [dot=.5] () to (c4.north);}
[$c$, l sep=15mm, name=c3, tikz={\draw [line, bend left] (.south) to (one.east); \draw [dot=.3, bend left] (.south east) to (one.south east);}
[,phantom]
[$0$, rectangle, draw, name=zero]
]
[$c$, name=c4, tikz={\draw [line, bend left] (.south) to (zero.north); \draw [dot=.5, bend left] () to (zero.north east);}]
]
]
]
\end{forest}
\end{center}

29
bdds/1013.tex

@ -0,0 +1,29 @@
\item \BDDToROBDD
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=5mm,
l sep=5mm}
[$f$, rectangle, draw, tikz={\draw [fulldot=.5] () to (a.north);}
[$a$, name=a, tikz={\draw [line] () to (b1.north); \draw [dot=.5] () to (b2.north);}
[$b$, name=b1, tikz={\draw [line] () to (d1.north); \draw [dot=.5] () to (260:3.3);}
[$d$, name=d1, tikz={\draw [line] () to (c1.north); \draw [fulldot=.5] () to (255:4.6);}
[$c$, name=c1, tikz={\draw [line] () to (243:6.5); \draw [dot=.5] () to (253:6.05);}]
[,phantom]
]
[,phantom]
]
[$b$, name=b2, tikz={\draw [line] () to (d2.north); \draw [dot=.5] () to (300:3.7);}
[$d$, name=d2, tikz={\draw [line] () to (c2.north); \draw [fulldot=.5] () to (286:4.7);}
[$c$, name=c2, tikz={\draw [line] () to (265:5.8); \draw [dot=.5] () to (275:5.8);}]
[,phantom]
]
[,phantom]
]
]
]
\end{forest}
\end{center}

27
bdds/1014.tex

@ -0,0 +1,27 @@
\item \BDDToROBDD
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=5mm,
l sep=5mm}
[$f$, rectangle, draw, tikz={\draw [line] () to (a.north);}
[$a$, name=a, tikz={\draw [line] () to (b1.north); \draw [fulldot=.5] () to (b2.north);}
[$b$, name=b1, tikz={\draw [line] () to (c1.north); \draw [dot=.5] () to (c2.north);}
[$c$, name=c1, tikz={\draw [line, bend right] () to (d1.north west); \draw [fulldot=.5, bend left] () to (d1.north east);}
[$d$, name=d1, tikz={\draw [line] () to (249:6.37); \draw [fulldot=.5] () to (256:6.13);}]
]
[$c$, name=c2, tikz={\draw [line] () to (258:4.7); \draw [fulldot=.5] () to (267:4.6);}]
]
[$b$, name=b2, tikz={\draw [line] () to (c3.north); \draw [dot=.5] () to (c4.north);}
[$c$, name=c3, tikz={\draw [line, bend right] () to (d2.north west); \draw [dot=.5, bend left] () to (d2.north east);}
[$d$, name=d2, tikz={\draw [line] () to (272:5.9); \draw [fulldot=.5] () to (280:5.98);}]
]
[$c$, name=c4, tikz={\draw [line] () to (288:4.83); \draw [fulldot=.5] () to (295:5.05);}]
]
]
]
\end{forest}
\end{center}

1
bdds/1015.tex

@ -0,0 +1 @@
\item \self In the context of \textit{Binary Decision Diagrams (BDDs)}, how does the variable order impact the BDD?

8
bdds/1016.tex

@ -0,0 +1,8 @@
\item \self Tick all properties that apply to a reduced and ordered BDD.
\begin{itemize}
\item[$\square$] If the \textit{else}-edge of a node is complemented, it may point to the same child node as the \textit{then}-edge.
\item[$\square$] Using the reduced and ordered BDD representation of formula $f$, it is possible to whether $f$ is valid in constant time.
\item[$\square$] The size of a BDD is independent on the variable order.
\item[$\square$] Using complemented edges, negation can be performed in constant time.
\item[$\square$] The size of a BDD is independent of the variable order.
\end{itemize}

6
bdds/1017.tex

@ -0,0 +1,6 @@
\item \self Tick all properties that apply to a \textit{reduced} and \textit{ordered} BDD (ROBDD).
\begin{itemize}
\item[$\square$] Checks for entailment can be done in constant time.
\item[$\square$] Some formulas that can be expressed by truth tables cannot be expressed by BDDs.
\item[$\square$] Equivalence checks can be performed in constant time (assuming that the BDDs for the formula to check are already available).
\end{itemize}

1
bdds/1018.tex

@ -0,0 +1 @@
\item When do we consider a BDD to be reduced? Explain the types of redudancies that are not allowed to appear in a reduced and ordered BDD.

22
bdds/1019.tex

@ -0,0 +1,22 @@
\item \BDDToDNF
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=2mm,
l sep=1mm}
[$f$, rectangle, draw, tikz={\draw [line] () to (a.north);}
[$a$, name=a, tikz={\draw [line] () to (b.north east); \draw [fulldot=.5] () to (d.north);}
[$b$, name=b, tikz={\draw [fulldot=.5, bend left] () to (c.north east); \draw [line, bend right] () to (c.north west);}
[$c$, name=c, s sep=20mm, tikz={\draw [line] () to (250:4); \draw [fulldot=.5] () to (d.north west);}
[,phantom]
[$d$, name=d, s sep=10mm, tikz={\draw [fulldot=.5] () to (287:5); \draw [line] () to (275:4.8);}]
]
]
[,phantom]
]
]
\end{forest}
\end{center}

21
bdds/1020.tex

@ -0,0 +1,21 @@
\item \BDDToDNF
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=10mm,
l sep=4mm}
[$f$, rectangle, draw, tikz={\draw [fulldot=.5] () to (c.north);}
[$c$, name=c, tikz={\draw [line] () to (d1.north); \draw [dot=.5] () to (d2.north);}
[$d$, name=d1, tikz={\draw [line] () to (b.north); \draw [dot=.5] () to (266:2.7);}
[$b$, name=b, tikz={\draw [line] () to (a.north); \draw [fulldot=.5] () to (266:3.8);}
[$a$, name=a, tikz={\draw [line] () to (256:5.2); \draw [fulldot=.5] () to (266:5);}]
]
]
[$d$, name=d2, tikz={\draw [line] () to (b.east); \draw [dot=.5] () to (a.east);}]
]
]
\end{forest}
\end{center}

26
bdds/1021.tex

@ -0,0 +1,26 @@
\item For the following binary decision diagram:
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=10mm,
l sep=5mm}
[$f$, rectangle, draw, tikz={\draw [fulldot=.5] () to (a.north);}
[$a$, name=a, tikz={\draw [line] () to (b1.north); \draw [fulldot=.5] () to (c.north);}
[$b$, name=b1, tikz={\draw [line, bend right] () to (d.north west); \draw [dot=.5, bend left] () to (d.north east);}
[$d$, name=d, tikz={\draw [line] () to (254:4.6); \draw [fulldot=.5] () to (265:4.42);}]
]
[$c$, name=c, tikz={\draw [line] () to (d.east); \draw [fulldot=.5] () to (291:3.53);}]
]
]
\end{forest}
\end{center}
Check if the following models are satisfying:
\begin{align*}
\Model_1 =~& \{a = \top, b = \top, c = \bot, d = \bot\},\\
\Model_2 =~& \{a = \bot, b = \bot, c = \top, d = \top\},\text{~and~}
\end{align*}
compute \DNF{f}.

28
bdds/1022.tex

@ -0,0 +1,28 @@
\item For the following binary decision diagram:
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=10mm,
l sep=5mm}
[$f$, rectangle, draw, tikz={\draw [line] () to (a.north);}
[$a$, name=a, tikz={\draw [line] () to (b1.north); \draw [fulldot=.5] () to (c2.north);}
[$b$, name=b1, tikz={\draw [line, bend right] () to (c1.north west); \draw [dot=.5, bend left] () to (c1.north east);}
[$c$, name=c1, tikz={\draw [line] () to (254:4.6); \draw [fulldot=.5] () to (265:4.42);}]
]
[$c$, name=c2, tikz={\draw [line] () to (277:3.35); \draw [fulldot=.5] () to (291:3.53);}]
]
]
\end{forest}
\end{center}
Check if the following models are satisfying:
\begin{align*}
\Model_1 =~&\{a = \top, b = \top, c = \bot\},\\
\Model_2 =~&\{a = \bot, b = \bot, c = \bot\},\text{~and~}
\end{align*}
compute \DNF{f}.

29
bdds/1023.tex

@ -0,0 +1,29 @@
\item For the following binary decision diagram:
Note: Else-edges are marked with circles. Filled circles represent the \emph{complemented} attribute. Dangling edges are assumed to point to the constant node \texttt{true}.
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=10mm,
l sep=5mm}
[$f$, rectangle, draw, tikz={\draw [fulldot=.5] () to (a.north);}
[$a$, name=a, tikz={\draw [line] () to (b1.north); \draw [fulldot=.5] () to (c.north);}
[$b$, name=b1, tikz={\draw [line, bend right] () to (d.north west); \draw [dot=.5, bend left] () to (d.north east);}
[$d$, name=d, tikz={\draw [line] () to (254:4.6); \draw [fulldot=.5] () to (265:4.42);}]
]
[$c$, name=c, tikz={\draw [line] () to (d.east); \draw [fulldot=.5] () to (291:3.53);}]
]
]
\end{forest}
\end{center}
Check if the following models are satisfying:
\begin{align*}
\Model_1 =~& \{a = \top, b = \top, c = \bot, d = \bot\},\\
\Model_2 =~& \{a = \bot, b = \bot, c = \top, d = \top\},\text{~and~}
\end{align*}
compute \DNF{f}.

1
bdds/1024.tex

@ -0,0 +1 @@
\item Give the definition of a cofactor of a formula $f$ with respect to an assignment $A$.

7
bdds/1025.tex

@ -0,0 +1,7 @@
\item \self Construct a Reduced Ordered Binary Decision Diagram (ROBDD) for the formula
$$f = (\neg a \vee b) \wedge (a \vee b),$$
using \textit{alphabetic variable order}. Use complemented edges and a node for \texttt{true} as the only constant node. To simplify drawing, you may assume that \textit{dangling edges} point to the constant node. Write down all cofactors that you compute to obtain the final result and mark them in the graph.
% (not a or b) and (a or b)

44
bdds/1025_sol.tex

@ -0,0 +1,44 @@
\begin{cofactors}
$f$ \= $= ((\lnot a \lor b) \land (a \lor b))$\\
\>$f_{b}$ \= $= \true$\\
\>$f_{\lnot b}$ \= $= \false$\\
\end{cofactors}
The final ROBDD:
\begin{center}
\scalebox{0.75}{
\begin{tikzpicture}[>=latex,line join=bevel,]
\pgfsetlinewidth{1bp}
%%
\pgfsetcolor{black}
% Edge: f_E -> b0
\draw [] (21.5bp,94.988bp) .. controls (21.5bp,84.921bp) and (21.5bp,69.474bp) .. (21.5bp,59.304bp);
% Edge: b0 -> 0
\draw [] (19.503bp,36.791bp) .. controls (16.934bp,23.663bp) and (12.77bp,2.3815bp) .. (12.513bp,1.0642bp);
% Edge: b0 -> 1
\draw [] (23.719bp,36.791bp) .. controls (26.573bp,23.663bp) and (31.2bp,2.3815bp) .. (31.486bp,1.0642bp);
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (27.237bp,20.608bp) node {\Large$\bullet$};
% Node: f_E
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (43.0bp,117.0bp) -- (0.0bp,117.0bp) -- (0.0bp,95.0bp) -- (43.0bp,95.0bp) -- cycle;
\draw (21.5bp,106.0bp) node {$f$};
\end{scope}
% Node: b0
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (21.5bp,48.0bp) ellipse (11.0bp and 11.0bp);
\draw (21.5bp,48.0bp) node {$b$};
\end{scope}
%
\end{tikzpicture}
}
\end{center}

6
bdds/1026.tex

@ -0,0 +1,6 @@
\item \self Construct a Reduced Ordered Binary Decision Diagram (ROBDD) for the formula
$$f = (\lnot x \lor \lnot y) \land (x \land (y \lor z)),$$
using \textit{variable order} $y < z < x$. Use complemented edges and a node for \texttt{true} as the only constant node. To simplify drawing, you may assume that \textit{dangling edges} point to the constant node. Write down all cofactors that you compute to obtain the final result and mark them in the graph.
% (not x or not y) and (x and (y or z))

91
bdds/1026_sol.tex

@ -0,0 +1,91 @@
\begin{cofactors}
$f$ \= $= ((\lnot x \lor \lnot y) \land (x \land (y \lor z)))$\\
\>$f_{y}$ \= $= \false$\\
\>$f_{\lnot y}$ \= $= (x \land z)$\\
\>\>$f_{\lnot yz}$ \= $= x$\\
\>\>\>$f_{\lnot yzx}$ \= $= \true$\\
\>\>\>$f_{\lnot yz\lnot x}$ \= $= \false$\\
\>\>$f_{\lnot y\lnot z}$ \= $= \false$\\
\end{cofactors}
The final ROBDD:
\begin{center}
\scalebox{0.75}{
\begin{tikzpicture}[>=latex,line join=bevel,]
\pgfsetlinewidth{1bp}
%%
\pgfsetcolor{black}
% Edge: f_E -> y0
\draw [] (72.5bp,210.99bp) .. controls (72.5bp,200.92bp) and (72.5bp,185.47bp) .. (72.5bp,175.3bp);
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (72.5bp,195.3bp) node {\Large$\bullet$};
% Edge: f_!y -> z1
\draw [] (25.254bp,152.99bp) .. controls (29.124bp,142.67bp) and (35.113bp,126.7bp) .. (38.918bp,116.55bp);
% Edge: f_!yz -> x2
\draw [] (108.92bp,94.988bp) .. controls (105.24bp,84.669bp) and (99.535bp,68.698bp) .. (95.911bp,58.551bp);
% Edge: y0 -> z1
\draw [] (67.68bp,154.0bp) .. controls (62.115bp,143.61bp) and (53.01bp,126.62bp) .. (47.408bp,116.16bp);
\draw (56.852bp,133.79bp) node {\Large$\bullet$};
% Edge: y0 -> 0
\draw [] (72.5bp,152.99bp) .. controls (72.5bp,137.38bp) and (72.5bp,108.85bp) .. (72.5bp,107.09bp);
% Edge: z1 -> x2
\draw [] (49.452bp,97.213bp) .. controls (59.005bp,86.514bp) and (76.085bp,67.385bp) .. (85.607bp,56.72bp);
% Edge: z1 -> 3
\draw [] (42.5bp,94.988bp) .. controls (42.5bp,79.384bp) and (42.5bp,50.854bp) .. (42.5bp,49.086bp);
\draw (42.5bp,69.086bp) node {\Large$\bullet$};
% Edge: x2 -> 1
\draw [] (90.503bp,36.791bp) .. controls (87.934bp,23.663bp) and (83.77bp,2.3815bp) .. (83.513bp,1.0642bp);
% Edge: x2 -> 2
\draw [] (94.719bp,36.791bp) .. controls (97.573bp,23.663bp) and (102.2bp,2.3815bp) .. (102.49bp,1.0642bp);
\draw (98.237bp,20.608bp) node {\Large$\bullet$};
% Node: f_E
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (94.0bp,233.0bp) -- (51.0bp,233.0bp) -- (51.0bp,211.0bp) -- (94.0bp,211.0bp) -- cycle;
\draw (72.5bp,222.0bp) node {$f$};
\end{scope}
% Node: y0
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (72.5bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (72.5bp,164.0bp) node {$y$};
\end{scope}
% Node: f_!y
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (43.0bp,175.0bp) -- (0.0bp,175.0bp) -- (0.0bp,153.0bp) -- (43.0bp,153.0bp) -- cycle;
\draw (21.5bp,164.0bp) node {$f_{\lnot y}$};
\end{scope}
% Node: z1
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (42.5bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (42.5bp,106.0bp) node {$z$};
\end{scope}
% Node: f_!yz
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (134.0bp,117.0bp) -- (91.0bp,117.0bp) -- (91.0bp,95.0bp) -- (134.0bp,95.0bp) -- cycle;
\draw (112.5bp,106.0bp) node {$f_{\lnot yz}$};
\end{scope}
% Node: x2
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (92.5bp,48.0bp) ellipse (11.0bp and 11.0bp);
\draw (92.5bp,48.0bp) node {$x$};
\end{scope}
%
\end{tikzpicture}
}
\end{center}

7
bdds/1027.tex

@ -0,0 +1,7 @@
\item \self Construct a Reduced Ordered Binary Decision Diagram (ROBDD) for the formula
$$f = (\lnot x \land \lnot y)\lor (x \land y),$$
using \textit{variable order} $z < x < y$. Use complemented edges and a node for \texttt{true} as the only constant node. To simplify drawing, you may assume that \textit{dangling edges} point to the constant node. Write down all cofactors that you compute to obtain the final result and mark them in the graph.
% (not x and not y) or (x and y)

67
bdds/1027_sol.tex

@ -0,0 +1,67 @@
\begin{cofactors}
$f$ \= $= ((\lnot x \land \lnot y) \lor (x \land y))$\\
\>$f_{y}$ \= $= x$\\
\>\>$f_{yx}$ \= $= \true$\\
\>\>$f_{y\lnot x}$ \= $= \false$\\
\>$f_{\lnot y}$ \= $= \lnot f_y$\\
\end{cofactors}
The final ROBDD:
\begin{center}
\scalebox{0.75}{
\begin{tikzpicture}[>=latex,line join=bevel,]
\pgfsetlinewidth{1bp}
%%
\pgfsetcolor{black}
% Edge: f_E -> y0
\draw [] (21.5bp,152.99bp) .. controls (21.5bp,142.92bp) and (21.5bp,127.47bp) .. (21.5bp,117.3bp);
% Edge: f_y -> x1
\draw [] (63.382bp,94.988bp) .. controls (53.412bp,84.04bp) and (37.646bp,66.729bp) .. (28.57bp,56.763bp);
% Edge: y0 -> x1
\draw [] (16.385bp,96.003bp) .. controls (14.19bp,85.491bp) and (14.205bp,68.213bp) .. (16.429bp,57.79bp);
% Edge: y0 -> x1
\draw [] (26.615bp,96.003bp) .. controls (28.81bp,85.491bp) and (28.795bp,68.213bp) .. (26.571bp,57.79bp);
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (30.134bp,77.47bp) node {\Large$\bullet$};
% Edge: x1 -> 0
\draw [] (19.503bp,36.791bp) .. controls (16.934bp,23.663bp) and (12.77bp,2.3815bp) .. (12.513bp,1.0642bp);
% Edge: x1 -> 1
\draw [] (23.719bp,36.791bp) .. controls (26.573bp,23.663bp) and (31.2bp,2.3815bp) .. (31.486bp,1.0642bp);
\draw (27.237bp,20.608bp) node {\Large$\bullet$};
% Node: f_E
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (43.0bp,175.0bp) -- (0.0bp,175.0bp) -- (0.0bp,153.0bp) -- (43.0bp,153.0bp) -- cycle;
\draw (21.5bp,164.0bp) node {$f$};
\end{scope}
% Node: y0
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (21.5bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (21.5bp,106.0bp) node {$y$};
\end{scope}
% Node: f_y
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (94.0bp,117.0bp) -- (51.0bp,117.0bp) -- (51.0bp,95.0bp) -- (94.0bp,95.0bp) -- cycle;
\draw (72.5bp,106.0bp) node {$f_{y}$};
\end{scope}
% Node: x1
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (21.5bp,48.0bp) ellipse (11.0bp and 11.0bp);
\draw (21.5bp,48.0bp) node {$x$};
\end{scope}
%
\end{tikzpicture}
}
\end{center}

7
bdds/1028.tex

@ -0,0 +1,7 @@
\item \self Construct a Reduced Ordered Binary Decision Diagram (ROBDD) for the formula
$$f = (\neg p \vee r) \land (q \vee \neg p) \land (\neg q \vee p) $$
using \textit{variable order} $r < q < p$. Use complemented edges and a node for \texttt{true} as the only constant node. To simplify drawing, you may assume that \textit{dangling edges} point to the constant node. Write down all cofactors that you compute to obtain the final result and mark them in the graph.
% (not p or r) and (q or not p) and (not q or p)

138
bdds/1028_sol.tex

@ -0,0 +1,138 @@
\begin{cofactors}
$f$ \= $= (((\lnot p \lor r) \land (q \lor \lnot p)) \land (\lnot q \lor p))$\\
\>$f_{r}$ \= $= ((q \lor \lnot p) \land (\lnot q \lor p))$\\
\>\>$f_{rq}$ \= $= p$\\
\>\>\>$f_{rqp}$ \= $= \true$\\
\>\>\>$f_{rq\lnot p}$ \= $= \false$\\
\>\>$f_{r\lnot q}$ \= $= \lnot f_{rq}$\\
\>$f_{\lnot r}$ \= $= ((\lnot p \land (q \lor \lnot p)) \land (\lnot q \lor p))$\\
\>\>$f_{\lnot rq}$ \= $= \false$\\
\>\>$f_{\lnot r\lnot q}$ \= $= (\lnot p \land \lnot p)$\\
\>\>\>$f_{\lnot r\lnot qp}$ \= $= \false$\\
\>\>\>$f_{\lnot r\lnot q\lnot p}$ \= $= \true$\\
\end{cofactors}
The final ROBDD:
\begin{center}
\scalebox{0.75}{
\begin{tikzpicture}[>=latex,line join=bevel,]
\pgfsetlinewidth{1bp}
%%
\pgfsetcolor{black}
% Edge: f_E -> r0
\draw [] (72.5bp,210.99bp) .. controls (72.5bp,200.92bp) and (72.5bp,185.47bp) .. (72.5bp,175.3bp);
% Edge: f_r -> q1
\draw [] (123.5bp,152.99bp) .. controls (123.5bp,142.92bp) and (123.5bp,127.47bp) .. (123.5bp,117.3bp);
% Edge: f_rq -> p2
\draw [] (165.38bp,94.988bp) .. controls (155.41bp,84.04bp) and (139.65bp,66.729bp) .. (130.57bp,56.763bp);
% Edge: f_!r -> q3
\draw [] (21.5bp,152.99bp) .. controls (21.5bp,142.92bp) and (21.5bp,127.47bp) .. (21.5bp,117.3bp);
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (21.5bp,137.3bp) node {\Large$\bullet$};
% Edge: f_!r!q -> p4
\draw [] (70.712bp,94.988bp) .. controls (68.892bp,84.795bp) and (66.087bp,69.087bp) .. (64.272bp,58.925bp);
\draw (67.788bp,78.614bp) node {\Large$\bullet$};
% Edge: r0 -> q3
\draw [] (65.409bp,155.21bp) .. controls (55.665bp,144.51bp) and (38.243bp,125.38bp) .. (28.531bp,114.72bp);
\draw (41.998bp,129.51bp) node {\Large$\bullet$};
% Edge: r0 -> q1
\draw [] (79.591bp,155.21bp) .. controls (89.335bp,144.51bp) and (106.76bp,125.38bp) .. (116.47bp,114.72bp);
% Edge: q3 -> p4
\draw [] (27.55bp,96.737bp) .. controls (35.301bp,86.149bp) and (48.662bp,67.901bp) .. (56.425bp,57.297bp);
\draw (44.611bp,73.434bp) node {\Large$\circ$};
% Edge: q3 -> 2
\draw [] (21.5bp,94.988bp) .. controls (21.5bp,79.384bp) and (21.5bp,50.854bp) .. (21.5bp,49.086bp);
% Edge: p4 -> 3
\draw [] (60.281bp,36.791bp) .. controls (57.427bp,23.663bp) and (52.8bp,2.3815bp) .. (52.514bp,1.0642bp);
% Edge: p4 -> 4
\draw [] (64.497bp,36.791bp) .. controls (67.066bp,23.663bp) and (71.23bp,2.3815bp) .. (71.487bp,1.0642bp);
\draw (67.647bp,20.692bp) node {\Large$\bullet$};
% Edge: q1 -> p2
\draw [] (118.39bp,96.003bp) .. controls (116.19bp,85.491bp) and (116.21bp,68.213bp) .. (118.43bp,57.79bp);
% Edge: q1 -> p2
\draw [] (128.61bp,96.003bp) .. controls (130.81bp,85.491bp) and (130.79bp,68.213bp) .. (128.57bp,57.79bp);
\draw (132.13bp,77.47bp) node {\Large$\bullet$};
% Edge: p2 -> 0
\draw [] (121.28bp,36.791bp) .. controls (118.43bp,23.663bp) and (113.8bp,2.3815bp) .. (113.51bp,1.0642bp);
% Edge: p2 -> 1
\draw [] (125.5bp,36.791bp) .. controls (128.07bp,23.663bp) and (132.23bp,2.3815bp) .. (132.49bp,1.0642bp);
\draw (128.65bp,20.692bp) node {\Large$\bullet$};
% Node: f_E
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (94.0bp,233.0bp) -- (51.0bp,233.0bp) -- (51.0bp,211.0bp) -- (94.0bp,211.0bp) -- cycle;
\draw (72.5bp,222.0bp) node {$f$};
\end{scope}
% Node: r0
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (72.5bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (72.5bp,164.0bp) node {$r$};
\end{scope}
% Node: f_r
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (145.0bp,175.0bp) -- (102.0bp,175.0bp) -- (102.0bp,153.0bp) -- (145.0bp,153.0bp) -- cycle;
\draw (123.5bp,164.0bp) node {$f_{r}$};
\end{scope}
% Node: q1
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (123.5bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (123.5bp,106.0bp) node {$q$};
\end{scope}
% Node: f_rq
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (196.0bp,117.0bp) -- (153.0bp,117.0bp) -- (153.0bp,95.0bp) -- (196.0bp,95.0bp) -- cycle;
\draw (174.5bp,106.0bp) node {$f_{rq}$};
\end{scope}
% Node: p2
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (123.5bp,48.0bp) ellipse (11.0bp and 11.0bp);
\draw (123.5bp,48.0bp) node {$p$};
\end{scope}
% Node: f_!r
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (43.0bp,175.0bp) -- (0.0bp,175.0bp) -- (0.0bp,153.0bp) -- (43.0bp,153.0bp) -- cycle;
\draw (21.5bp,164.0bp) node {$f_{\lnot r}$};
\end{scope}
% Node: q3
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (21.5bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (21.5bp,106.0bp) node {$q$};
\end{scope}
% Node: f_!r!q
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (94.0bp,117.0bp) -- (51.0bp,117.0bp) -- (51.0bp,95.0bp) -- (94.0bp,95.0bp) -- cycle;
\draw (72.5bp,106.0bp) node {$f_{\lnot r\lnot q}$};
\end{scope}
% Node: p4
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (62.5bp,48.0bp) ellipse (11.0bp and 11.0bp);
\draw (62.5bp,48.0bp) node {$p$};
\end{scope}
%
\end{tikzpicture}
}
\end{center}

7
bdds/1029.tex

@ -0,0 +1,7 @@
\item \self Construct a Reduced Ordered Binary Decision Diagram (ROBDD) for the formula
$$f = (q \land \lnot s) \lor (s \land (\neg r \vee p)) \lor (p \land q \land r)$$
using \textit{variable order} $p < q < r < s$. Use complemented edges and a node for \texttt{true} as the only constant node. To simplify drawing, you may assume that \textit{dangling edges} point to the constant node. Write down all cofactors that you compute to obtain the final result and mark them in the graph.
% (q and not s) or (s and (not r or p)) or (p and q and r)

162
bdds/1029_sol.tex

@ -0,0 +1,162 @@
\begin{cofactors}
$f$ \= $= (((q \land \lnot s) \lor (s \land (\lnot r \lor p))) \lor ((p \land q) \land r))$\\
\>$f_{p}$ \= $= (((q \land \lnot s) \lor s) \lor (q \land r))$\\
\>\>$f_{pq}$ \= $= \true$\\
\>\>$f_{p\lnot q}$ \= $= s$\\
\>\>\>$f_{p\lnot qs}$ \= $= \true$\\
\>\>\>$f_{p\lnot q\lnot s}$ \= $= \false$\\
\>$f_{\lnot p}$ \= $= ((q \land \lnot s) \lor (s \land \lnot r))$\\
\>\>$f_{\lnot pq}$ \= $= (\lnot s \lor (s \land \lnot r))$\\
\>\>\>$f_{\lnot pqr}$ \= $= \lnot f_{p\lnot q}$\\
\>\>\>$f_{\lnot pq\lnot r}$ \= $= \true$\\
\>\>$f_{\lnot p\lnot q}$ \= $= (s \land \lnot r)$\\
\>\>\>$f_{\lnot p\lnot qr}$ \= $= \false$\\
\>\>\>$f_{\lnot p\lnot q\lnot r}$ \= $= f_{p\lnot q}$\\
\end{cofactors}
The final ROBDD:
\begin{center}
\scalebox{0.75}{
\begin{tikzpicture}[>=latex,line join=bevel,]
\pgfsetlinewidth{1bp}
%%
\pgfsetcolor{black}
% Edge: f_E -> p0
\draw [] (123.5bp,268.99bp) .. controls (123.5bp,258.92bp) and (123.5bp,243.47bp) .. (123.5bp,233.3bp);
% Edge: f_p -> q1
\draw [] (174.5bp,210.99bp) .. controls (174.5bp,200.92bp) and (174.5bp,185.47bp) .. (174.5bp,175.3bp);
% Edge: f_p!q -> s2
\draw [] (74.288bp,94.988bp) .. controls (76.108bp,84.795bp) and (78.913bp,69.087bp) .. (80.728bp,58.925bp);
% Edge: f_!p -> q3
\draw [] (72.5bp,210.99bp) .. controls (72.5bp,200.92bp) and (72.5bp,185.47bp) .. (72.5bp,175.3bp);
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (72.5bp,195.3bp) node {\Large$\bullet$};
% Edge: f_!pq -> r4
\draw [] (123.5bp,152.99bp) .. controls (123.5bp,142.92bp) and (123.5bp,127.47bp) .. (123.5bp,117.3bp);
\draw (123.5bp,137.3bp) node {\Large$\bullet$};
% Edge: f_!p!q -> r5
\draw [] (21.5bp,152.99bp) .. controls (21.5bp,142.92bp) and (21.5bp,127.47bp) .. (21.5bp,117.3bp);
\draw (21.5bp,137.3bp) node {\Large$\bullet$};
% Edge: p0 -> q3
\draw [] (116.41bp,213.21bp) .. controls (106.66bp,202.51bp) and (89.243bp,183.38bp) .. (79.531bp,172.72bp);
\draw (92.998bp,187.51bp) node {\Large$\bullet$};
% Edge: p0 -> q1
\draw [] (130.59bp,213.21bp) .. controls (140.34bp,202.51bp) and (157.76bp,183.38bp) .. (167.47bp,172.72bp);
% Edge: q3 -> r5
\draw [] (65.409bp,155.21bp) .. controls (55.665bp,144.51bp) and (38.243bp,125.38bp) .. (28.531bp,114.72bp);
\draw (41.998bp,129.51bp) node {\Large$\circ$};
% Edge: q3 -> r4
\draw [] (79.591bp,155.21bp) .. controls (89.335bp,144.51bp) and (106.76bp,125.38bp) .. (116.47bp,114.72bp);
% Edge: r5 -> s2
\draw [] (29.226bp,97.908bp) .. controls (40.895bp,87.195bp) and (62.899bp,66.995bp) .. (74.644bp,56.212bp);
\draw (59.911bp,69.737bp) node {\Large$\bullet$};
% Edge: r5 -> 4
\draw [] (21.5bp,94.988bp) .. controls (21.5bp,79.384bp) and (21.5bp,50.854bp) .. (21.5bp,49.086bp);
% Edge: r4 -> s2
\draw [] (117.45bp,96.737bp) .. controls (109.7bp,86.149bp) and (96.338bp,67.901bp) .. (88.575bp,57.297bp);
% Edge: r4 -> 3
\draw [] (123.5bp,94.988bp) .. controls (123.5bp,79.384bp) and (123.5bp,50.854bp) .. (123.5bp,49.086bp);
\draw (123.5bp,69.086bp) node {\Large$\bullet$};
% Edge: q1 -> s2
\draw [] (171.65bp,152.93bp) .. controls (167.29bp,138.85bp) and (157.95bp,113.01bp) .. (143.5bp,95.0bp) .. controls (128.72bp,76.585bp) and (105.0bp,61.54bp) .. (91.923bp,54.08bp);
\draw (109.2bp,64.149bp) node {\Large$\circ$};
% Edge: q1 -> 0
\draw [] (177.46bp,153.25bp) .. controls (182.18bp,137.7bp) and (190.93bp,108.87bp) .. (191.47bp,107.09bp);
% Edge: s2 -> 1
\draw [] (80.281bp,36.791bp) .. controls (77.427bp,23.663bp) and (72.8bp,2.3815bp) .. (72.514bp,1.0642bp);
% Edge: s2 -> 2
\draw [] (84.497bp,36.791bp) .. controls (87.066bp,23.663bp) and (91.23bp,2.3815bp) .. (91.487bp,1.0642bp);
\draw (87.647bp,20.692bp) node {\Large$\bullet$};
% Node: f_E
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (145.0bp,291.0bp) -- (102.0bp,291.0bp) -- (102.0bp,269.0bp) -- (145.0bp,269.0bp) -- cycle;
\draw (123.5bp,280.0bp) node {$f$};
\end{scope}
% Node: p0
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (123.5bp,222.0bp) ellipse (11.0bp and 11.0bp);
\draw (123.5bp,222.0bp) node {$p$};
\end{scope}
% Node: f_p
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (196.0bp,233.0bp) -- (153.0bp,233.0bp) -- (153.0bp,211.0bp) -- (196.0bp,211.0bp) -- cycle;
\draw (174.5bp,222.0bp) node {$f_{p}$};
\end{scope}
% Node: q1
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (174.5bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (174.5bp,164.0bp) node {$q$};
\end{scope}
% Node: f_p!q
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (94.0bp,117.0bp) -- (51.0bp,117.0bp) -- (51.0bp,95.0bp) -- (94.0bp,95.0bp) -- cycle;
\draw (72.5bp,106.0bp) node {$f_{p\lnot q}$};
\end{scope}
% Node: s2
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (82.5bp,48.0bp) ellipse (11.0bp and 11.0bp);
\draw (82.5bp,48.0bp) node {$s$};
\end{scope}
% Node: f_!p
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (94.0bp,233.0bp) -- (51.0bp,233.0bp) -- (51.0bp,211.0bp) -- (94.0bp,211.0bp) -- cycle;
\draw (72.5bp,222.0bp) node {$f_{\lnot p}$};
\end{scope}
% Node: q3
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (72.5bp,164.0bp) ellipse (11.0bp and 11.0bp);
\draw (72.5bp,164.0bp) node {$q$};
\end{scope}
% Node: f_!pq
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (145.0bp,175.0bp) -- (102.0bp,175.0bp) -- (102.0bp,153.0bp) -- (145.0bp,153.0bp) -- cycle;
\draw (123.5bp,164.0bp) node {$f_{\lnot pq}$};
\end{scope}
% Node: r4
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (123.5bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (123.5bp,106.0bp) node {$r$};
\end{scope}
% Node: f_!p!q
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (43.0bp,175.0bp) -- (0.0bp,175.0bp) -- (0.0bp,153.0bp) -- (43.0bp,153.0bp) -- cycle;
\draw (21.5bp,164.0bp) node {$f_{\lnot p\lnot q}$};
\end{scope}
% Node: r5
\begin{scope}
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (21.5bp,106.0bp) ellipse (11.0bp and 11.0bp);
\draw (21.5bp,106.0bp) node {$r$};
\end{scope}
%
\end{tikzpicture}
}
\end{center}

36
bdds/1030.tex

@ -0,0 +1,36 @@
\begin{minipage}{.65\textwidth}
\begin{enumerate}
\item Use the BDD shown in the figure on the right to check if the formula it represents evaluates to \texttt{true} or \texttt{false} with the
following variable assignments.
\begin{enumerate}
\item $\mathcal{M}_1: ~ p = \top, r = \bot, q = \top, s=\bot$
\item $\mathcal{M}_2: ~ p = \bot, r = \bot, q = \bot, s=\top$
\end{enumerate}
\item Find the formula $f$ that is represented by the BDD.
\end{enumerate}
\end{minipage}
\begin{minipage}{.3\textwidth}
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=6mm,
l sep=6mm}
[$f$, rectangle, draw, tikz={\draw [fulldot=.5] () to (p.north);}
[$p$, name=p, tikz={\draw [line] () to (r1.north); \draw [fulldot=.5] () to (r2.north);}
[$r$, name=r1, tikz={\draw [line] () to (254:3.8); \draw [fulldot=.5] () to (q1.north west);}]
[$r$, name=r2, tikz={\draw [line] () to (q1.north east); \draw [dot=.5] () to (q2.north west);}
[$q$, name=q1, tikz={\draw [line] () to (s.north); \draw[fulldot=.5] () to (277:5);}
[$s$, name=s, tikz={\draw [line] () to (260:6.3); \draw[fulldot=.5] () to (268:6.2);}]
[,phantom]
]
[$q$, name=q2, tikz={\draw [line] () to (280:5.03); \draw[fulldot=.5] () to (290:5.23);}]
]
]
]
\end{forest}
\end{center}
\end{minipage}

39
bdds/1031.tex

@ -0,0 +1,39 @@
\item Use the BDD shown in the figure on the right to check if the formula it represents evaluates to \texttt{true} or \texttt{false} with the
following variable assignments.
\begin{minipage}{.65\textwidth}
\begin{enumerate}
\begin{enumerate}
\item $\mathcal{M}_1: ~ a = \bot, b = \top, c = \bot, d = \top$
\item $\mathcal{M}_2: ~ a = \top, b = \top, c = \top, d = \top$
\end{enumerate}
\item Find the formula $f$ that is represented by the BDD.
\end{enumerate}
\end{minipage}
\begin{minipage}{.3\textwidth}
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=5mm,
l sep=5mm}
[$f$, rectangle, draw, tikz={\draw [fulldot=.5] () to (c.north);}
[$c$, name=c, tikz={\draw [line] () to (d1.north); \draw [dot=.5] () to (d2.north);}
[$d$, name=d1, tikz={\draw [line] () to (b1.north); \draw [fulldot=.5] () to (261:3.25);}
[$b$, name=b1, tikz={\draw [line] () to (242:5); \draw [fulldot=.5] () to (256:4.55);}]
[,phantom]
]
[$d$, name=d2, tikz={\draw [line] () to (b2.north); \draw [dot=.5] () to (299:3.7);}
[$b$, name=b2, tikz={\draw [line] () to (a.north); \draw [dot=.5] () to (286:4.6);}
[$a$, name=a, tikz={\draw [line] () to (264:5.7); \draw [fulldot=.5] () to (276:5.7);}]
[,phantom]
]
[,phantom]
]
]
]
\end{forest}
\end{center}
\end{minipage}

10
bdds/1031_sol.tex

@ -0,0 +1,10 @@
\begin{enumerate}
\item
\begin{enumerate}
\item false
\item false
\end{enumerate}
\item
$f = (p \land \lnot r \land q \land s) \lor (\lnot p \land r \land q \land s) \lor (\lnot p \land \lnot r \land q)$
\end{enumerate}

29
bdds/1032.tex

@ -0,0 +1,29 @@
\item \self Convert the following BDD into a \emph{reduced ordered} BDD.
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=6mm,
l sep=6mm}
[$f$, rectangle, draw, tikz={\draw [line] () to (p.north);}
[$q$, name=q, tikz={\draw [line] () to (s1.north); \draw [dot=.5] () to (s2.north);}
[$s$, name=s1, tikz={\draw [line] () to (240:4.1); \draw [fulldot=.5] () to (r1.north);}
[,phantom]
[$r$, name=r1, tikz={\draw [line] () to (p1.north); \draw[dot=.5] () to (p2.north);}
[$p$, name=p1, tikz={\draw [line] () to (254:6.57); \draw[fulldot=.5] () to (263:6.37);}]
[$p$, name=p2, tikz={\draw [line] () to (266:6.33); \draw[dot=.5] () to (275:6.35);}]
]
]
[$s$, name=s2, tikz={\draw [line] () to (281:3.6); \draw [fulldot=.5] () to (r2.north);}
[,phantom]
[$r$, name=r2, tikz={\draw [line] () to (p3.north); \draw[dot=.5] () to (p4.north);}
[$p$, name=p3, tikz={\draw [line] () to (277:6.38); \draw[fulldot=.5] () to (286:6.6);}]
[$p$, name=p4, tikz={\draw [line] () to (288:6.65); \draw[dot=.5] () to (297:7.1);}]
]
]
]
]
\end{forest}
\end{center}

18
bdds/1032_sol.tex

@ -0,0 +1,18 @@
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=6mm,
l sep=6mm}
[$f$, rectangle, draw, tikz={\draw [line] () to (s.north);}
[$s$, name=s, tikz={\draw [line] () to (-0.6, -2.2); \draw [fulldot=.5] () to (r.north);}
[,phantom]
[$r$, name=r, tikz={\draw [line] () to (p.north); \draw[dot=.5] () to (1.3,-3.5);}
[$p$, name=p, tikz={\draw [line] () to (-0.6, -4.8); \draw[fulldot=.5] () to (0.6, -4.8);}]
[,phantom]
]
]
]
\end{forest}
\end{center}

5
bdds/1033.tex

@ -0,0 +1,5 @@
\item \self Construct a ROBDD for the formula
$$f =(a\land d\land c)\lor(b\land\lnot d\land\lnot a)\lor(c \implies \lnot d) \lor (a \implies \lnot b)$$
using \textit{variable order} $b < a < d < c$. Use complemented edges and a node for \texttt{true} as the only constant node. To simplify drawing, you may assume that \textit{dangling edges} point to the constant node. Write down all cofactors that you compute to obtain the final result and mark them in the graph.

21
bdds/1033_sol.tex

@ -0,0 +1,21 @@
\begin{minipage}{0.5\textwidth}
\begin{tabbing}
$f$ \= $= (a\land d\land c)\lor(b\land\lnot d\land\lnot a)\lor(c \implies \lnot d) \lor (a \implies \lnot b)$\\
\>$ f_b $ \= $= \top$ \\
\>$ f_{\lnot b} =\top$ \\
\end{tabbing}
\end{minipage}
\begin{minipage}{0.5\textwidth}
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=5mm,
l sep=5mm}
[$f$, rectangle, draw, tikz={\draw [line] () to (0,-1);}
]
\end{forest}
\end{center}
\end{minipage}

5
bdds/1034.tex

@ -0,0 +1,5 @@
\item \self Construct a reduced ordered binary decision diagram (ROBDD) for the formula
$$f = (p \oplus q) \land \lnot r$$
using \textit{variable order} $p < q < r$. Use complemented edges and a node for \texttt{true} as the only constant node. To simplify drawing, you may assume that \textit{dangling edges} point to the constant node. Write down all cofactors that you compute to obtain the final result and mark them in the graph.

40
bdds/1034_sol.tex

@ -0,0 +1,40 @@
\begin{minipage}{0.5\textwidth}
\begin{tabbing}
$f$ \= $= (p \oplus q) \land \lnot r$\\
\>$ f_p $ \= $= \lnot q \land \lnot r$ \\
\>\>$ f_{pq} $ \= $= \bot$ \\
\>\>$ f_{p \lnot q} $ \= $= \lnot r$ \\
\>\>\>$ f_{p \lnot q r} $ \= $= \bot$ \\
\>\>\>$ f_{p \lnot q \lnot r} $ \= $= \top$ \\
\>$ f_{\lnot p} = q \land \lnot r$ \\
\>\>$ f_{\lnot pq} $ \= $= \lnot r = f_{p \lnot q}$ \\
\>\>$ f_{\lnot p \lnot q} $ \= $= \bot$ \\
\end{tabbing}
\end{minipage}
\begin{minipage}{0.5\textwidth}
The final ROBDD:
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=6mm,
l sep=6mm}
[$f$, rectangle, draw, tikz={\draw [fulldot=.3] () to (p.north);}
[$f_q$, rectangle, draw, tikz={\draw [fulldot=.3] () to (q1.north);}]
[$p$, name=p, tikz={\draw [line] () to (q1.north east); \draw [dot=.3] () to (q2.north west);}
[$q$, name=q1, tikz={\draw [line] () to (-2,-3.5); \draw [dot=.3] () to (r.north west);}
[$f_{p \lnot q}$, rectangle, draw, tikz={\draw [fulldot=.3] () to (r.west);}]
]
[$q$, name=q2, tikz={\draw [line] () to (r.north east); \draw [dot=.3] () to (2,-3.5);}
[$r$, name=r, tikz={\draw [line] () to (-0.5,-4.8); \draw [fulldot=.3] () to (0.5, -4.8);}]
[$f_{\lnot pq}$, rectangle, draw, tikz={\draw [fulldot=.3] () to (r.east);}]
[,phantom]
]
]
[$f_{\lnot q}$, rectangle, draw, tikz={\draw [fulldot=.3] () to (q2.north);}]
]
\end{forest}
\end{center}
\end{minipage}

5
bdds/1035.tex

@ -0,0 +1,5 @@
\item \self Construct a ROBDD for the formula
$$f = (p \leftrightarrow q) \land (r \leftrightarrow s)$$
using \textit{variable order} $r < s < p < q$. Use complemented edges and a node for \texttt{true} as the only constant node. To simplify drawing, you may assume that \textit{dangling edges} point to the constant node. Write down all cofactors that you compute to obtain the final result and mark them in the graph.

49
bdds/1035_sol.tex

@ -0,0 +1,49 @@
\begin{minipage}{0.5\textwidth}
\begin{tabbing}
$f$ \= $= (p \leftrightarrow q) \land (r \leftrightarrow s)$\\
\>$ f_r $ \= $= (p \leftrightarrow q) \land s$ \\
\>\>$ f_{rs} $ \= $= (p \leftrightarrow q)$ \\
\>\>\>$ f_{rsp} $ \= $= q$ \\
\>\>\>\>$ f_{rspq} $ \= $= \top$ \\
\>\>\>\>$ f_{rsp \lnot q} $ \= $= \bot$ \\
\>\>\>$ f_{rs \lnot p} $ \= $= \lnot q = \lnot f_{rsp}$ \\
\>\>$ f_{r \lnot s} $ \= $= \bot$ \\
\>$ f_{\lnot r} = (p \leftrightarrow q) \land \lnot s$ \\
\>\>$ f_{\lnot rs} $ \= $= \bot$ \\
\>\>$ f_{\lnot r \lnot s} $ \= $= (p \leftrightarrow q) = f_{rs}$ \\
\end{tabbing}
\end{minipage}
\begin{minipage}{0.5\textwidth}
The final ROBDD:
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=6mm,
l sep=6mm}
[$f$, rectangle, draw, tikz={\draw [line] () to (r.north);}
[$f_r$, rectangle, draw, tikz={\draw [line] () to (s1.north west);}]
[$r$, name=r, tikz={\draw [line] () to (s1.north); \draw [fulldot=.5] () to (s2.north);}
[$f_{\lnot r \lnot s}$, rectangle, draw, tikz={\draw [line] () to (p.north west);}]
[$f_{rs}$ , rectangle, draw, tikz={\draw [line] () to (p.north west);}]
[$s$, name=s1, tikz={\draw [line] () to (p.north); \draw [fulldot=.5] () to (-0.2, -3.5);}
[$f_{\lnot rsp}$, rectangle, draw, tikz={\draw [line] () to (q.north west);}]
[$p$, name=p, tikz={\draw [line, bend right=14] () to (q.north); \draw [fulldot=.5, bend left=14] () to (q.north east);}
[$q$, name=q, tikz={\draw [line] () to (-2.3, -6.2); \draw [fulldot=.5] () to (-1.5, -6.2);}
]
[,phantom]
]
[,phantom]
[,phantom]
]
[$s$, name=s2, tikz={\draw [line] () to (0.2,-3.5); \draw [fulldot=.5, bend left=70] () to (p.east);}]
[,phantom]
[,phantom]
]
[$f_{\lnot r}$, rectangle, draw, tikz={\draw [fulldot=.5] () to (s2.north east);}]
]
\end{forest}
\end{center}
\end{minipage}

11
bdds/1036.tex

@ -0,0 +1,11 @@
\item \self
\begin{enumerate}
\item Construct a Reduced Ordered Binary Decision Diagram (ROBDD) for the formula
$$f= (a \lor b \lor c) \land \lnot d$$
using \textit{variable order} $a < b < c < d$. Use complemented edges and a node for \texttt{true} as the only constant node. To simplify drawing, you may assume that \textit{dangling edges} point to the constant node. Write down all cofactors that you compute to obtain the final result and mark them in the graph.
\item Construct a Reduced Ordered Binary Decision Diagram (ROBDD) for $f$ with a different variable order. The ROBDD should result in a \textit{smaller} ROBDD, w.r.t. the number of nodes.
\end{enumerate}

100
bdds/1036_sol.tex

@ -0,0 +1,100 @@
\begin{enumerate}
\item using \textit{variable order} $c < a < d < b$:\\
\begin{minipage}{0.5\textwidth}
\begin{tabbing}
$f$ \= $= (a \lor b \lor c) \land \lnot d$\\
\>$ f_c $ \= $= \lnot d$ \\
\>\>$ f_{ca} $ \= $= \lnot d$ \\
\>\>$ f_{c \lnot a} $ \= $= \lnot d$ \\
\>\>\Rightarrow a does not have an influence\\
\>\>on the formula.\\
\>\>These cofactors can be skipped.\\
\>\>$ f_{cd} $ \= $= \bot$ \\
\>\>$ f_{c \lnot d} $ \= $= \top $ \\
\>$ f_{\lnot c} $ \= $= (a \lor b) \land \lnot d$ \\
\>\>$ f_{\lnot ca} $ \= $= \lnot d = f_{c}$ \\
\>\>$ f_{\lnot c \lnot a} $ \= $= b \land \lnot d$ \\
\>\>\>$ f_{\lnot c \lnot ad} $ \= $= \bot$ \\
\>\>\>$ f_{\lnot c \lnot a \lnot d} $ \= $= b$ \\
\>\>\>\>$ f_{\lnot c \lnot a \lnot db} $ \= $= \top$ \\
\>\>\>\>$ f_{\lnot c \lnot a \lnot db} $ \= $= \bot$ \\
\end{tabbing}
\end{minipage}
\begin{minipage}{0.5\textwidth}
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=6mm,
l sep=6mm}
[$f$, rectangle, draw, tikz={\draw [fulldot=.5] () to (c.north);}
[,phantom]
[$c$, name=c, tikz={\draw [line] () to (d1.north); \draw [dot=.5] () to (a.north);}
[$f_{c}$, rectangle, draw, tikz={\draw [fulldot=.5] () to (d1.north west);}]
[,phantom]
[$a$, name=a, tikz={\draw [line,bend left=30] () to (d1.north); \draw [dot=.5] () to (d2.north);}
[$d$, name=d1, tikz={\draw [line] () to (-2,-5); \draw [fulldot=.5] () to (-1,-5);}]
[,phantom]
[$d$, name=d2, tikz={\draw [line] () to (0.6,-5); \draw [fulldot=.5] () to (b.north);}
[,phantom]
[$b$, name=b, tikz={\draw [line] () to (1.3,-6.3); \draw [fulldot=.5] () to (2.3,-6.3);}]
]
[$f_{\lnot c \lnot a \lnot d}$, rectangle, draw, tikz={\draw [line] () to (b.north east);}]
]
[$f_{\lnot c \lnot a}$, rectangle, draw, tikz={\draw [fulldot=.5] () to (d2.north east);}]
]
[$f_{\lnot c}$, rectangle, draw, tikz={\draw [fulldot=.5] () to (a.north east);}]
]
\end{forest}
\end{center}
\end{minipage}
\item
using \textit{variable order} $d < a < b < c$:\\
\begin{minipage}{0.5\textwidth}
\begin{tabbing}
$f$ \= $= (a \lor b \lor c) \land \lnot d$\\
\>$ f_d $ \= $= \bot$ \\
\>$ f_{\lnot d} $ \= $= a \lor b \lor c$ \\
\>\>$ f_{\lnot da} $ \= $= \top$ \\
\>\>$ f_{\lnot d \lnot a} $ \= $= b \lor c$ \\
\>\>\>$ f_{\lnot d \lnot ab} $ \= $= \top$ \\
\>\>\>$ f_{\lnot d \lnot a \lnot b} $ \= $= c$ \\
\>\>\>\>$ f_{\lnot d \lnot a \lnot bc} $ \= $= \top$ \\
\>\>\>\>$ f_{\lnot d \lnot a \lnot b \lnot c} $ \= $= \bot$ \\
\end{tabbing}
\end{minipage}
\begin{minipage}{0.5\textwidth}
\begin{center}
\begin{forest}
for tree={circle, draw, no edge,
minimum size=2em,
inner sep=0pt,
s sep=6mm,
l sep=6mm}
[$f$, rectangle, draw, tikz={\draw [fulldot=.5] () to (d.north);}
[,phantom]
[$d$, name=d, tikz={\draw [line] () to (-0.5,-2.3); \draw [fulldot=.5] () to (a.north);}
[,phantom]
[,phantom]
[$a$, name=a, tikz={\draw [line] () to (0,-3.6); \draw [dot=.5] () to (b.north);}
[,phantom]
[,phantom]
[$b$, name=b, tikz={\draw [line] () to (0.5,-4.9); \draw [dot=.5] () to (c.north);}
[,phantom]
[,phantom]
[$c$, name=c, tikz={\draw [line] () to (1.3,-6.2); \draw [fulldot=.5] () to (2.3,-6.2);}
]
[,phantom]
]
[$f_{\lnot d \lnot a \lnot b}$, rectangle, draw, tikz={\draw [line] () to (c.north east);}]
]
[$f_{\lnot d \lnot a}$, rectangle, draw, tikz={\draw [line] () to (b.north east);}]
]
[$f_{\lnot d}$, rectangle, draw, tikz={\draw [line] () to (a.north east);}]
]
\end{forest}
\end{center}
\end{minipage}
\end{enumerate}

1
bdds/2018.tex

@ -0,0 +1 @@
\item Explain how a reduced and ordered BDD can be used to determine the satisfiability of the formula $f$ it is representing.

2
bdds/2019.tex

@ -0,0 +1,2 @@
\item Explain how a reduced and ordered BDD can be used to determine whether the formula $f$ it is representing is valid.

175
bdds/bdds.tex

@ -0,0 +1,175 @@
\begin{questionSection}{Reduced Ordered Binary Decision Diagrams}
\question{bdds/0001.tex}
{bdds/0001_sol.tex}
{3cm}
\question{bdds/0007.tex}
{bdds/0007_sol.tex}
{3cm}
\question{bdds/1019.tex}
{no_solution}
{3cm}
\question{bdds/1020.tex}
{no_solution}
{3cm}
\question{bdds/1021.tex}
{no_solution}
{3cm}
\question{bdds/1022.tex}
{no_solution}
{3cm}
\question{bdds/1023.tex}
{no_solution}
{3cm}
\question{bdds/0004.tex}
{bdds/0004_sol.tex}
{3cm}
\question{bdds/1013.tex}
{no_solution}
{3cm}
\question{bdds/1014.tex}
{no_solution}
{3cm}
\question{bdds/1012.tex}
{no_solution}
{3cm}
\question{bdds/0005.tex}
{bdds/0005_sol.tex}
{3cm}
% We start with theory questions here
\question{bdds/0006.tex}
{bdds/0006_sol.tex}
{3cm}
\question{bdds/1024.tex}
{no_solution}
{3cm}
\question{bdds/1005.tex}
{no_solution}
{3cm}
\mcquestion{bdds/1008.tex}
{bdds/1008.tex}
\question{bdds/1009.tex}
{no_solution}
{3cm}
\question{bdds/1010.tex}
{no_solution}
{3cm}
\question{bdds/1011.tex}
{no_solution}
{3cm}
\question{bdds/1015.tex}
{no_solution}
{3cm}
\mcquestion{bdds/1016.tex}
{bdds/1016.tex}
\question{bdds/1018.tex}
{no_solution}
{3cm}
\question{bdds/2018.tex}
{no_solution}
{3cm}
\question{bdds/2019.tex}
{no_solution}
{3cm}
\end{questionSection}
\clearpage
\begin{questionSection}{Construction of Reduced Ordered BDDs}
\question{bdds/1026.tex}
{bdds/1026_sol.tex}
{3cm}
\question{bdds/1027.tex}
{bdds/1027_sol.tex}
{3cm}
\question{bdds/1028.tex}
{bdds/1028_sol.tex}
{3cm}
\question{bdds/1029.tex}
{bdds/1029_sol.tex}
{3cm}
\question{bdds/1033.tex}
{bdds/1033_sol.tex}
{3cm}
\question{bdds/1034.tex}
{bdds/1034_sol.tex}
{3cm}
\question{bdds/1035.tex}
{bdds/1035_sol.tex}
{3cm}
\question{bdds/1036.tex}
{bdds/1036_sol.tex}
{3cm}
\question{bdds/0008.tex}
{bdds/0008_sol.tex}
{3cm}
\question{bdds/0009.tex}
{bdds/0009_sol.tex}
{3cm}
\question{bdds/0010.tex}
{bdds/0010_sol.tex}
{3cm}
%\section{New in 2024 - Remove me later} % TODO: Remove me!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\question{bdds/0012.tex}
{bdds/0012_sol.tex}
{3cm}
\question{bdds/0013.tex}
{bdds/0013_sol.tex}
{3cm}
\question{bdds/0014.tex}
{bdds/0014_sol.tex}
{3cm}
\question{bdds/0018.tex}
{bdds/0018_sol.tex}
{3cm}
\end{questionSection}

18
compile

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
. util/util.sh
TOGGLEFILE=util/toggle.tex
@ -7,9 +7,10 @@ ALLCHAPTERFILE=util/allchapter.tex
FILENAMEPREFIX=questionnaire
SINK=/dev/null
VALID_ARGS="bdh"
VALID_ARGS="abdh"
BURST=0
DEBUG=0
ANNOTATE=0
printUsage() {
printf "A shell wrapper for this questionnaire using latexmk.\n"
@ -18,6 +19,7 @@ printUsage() {
printf "Flags:\n"
printf " -b Compile in burst mode, i.e. each chapter into a individual file.\n"
printf " -d Print LuaLaTeX output to terminal.\n"
printf " -a Annotate all questions and solutions with their base filename.\n"
printf " -h Print this help message and exit.\n"
}
@ -30,6 +32,8 @@ do
;;
d) DEBUG=1
;;
a) ANNOTATE=1
;;
h) printUsage
info "Exiting..."
exit
@ -42,6 +46,10 @@ set_chapter() {
printf "$1\n" > $CHAPTERFILE
}
do_annotate() {
echo "\\annotatetrue" >> $TOGGLEFILE
}
rename() {
filename="$FILENAMEPREFIX"
while [ $# -gt 0 ]
@ -58,12 +66,14 @@ compile_file() {
if [ $mode = "solution" ]
then
echo "\solutiontrue" > $TOGGLEFILE
[ $ANNOTATE -eq 1 ] && do_annotate
[ "$#" -eq 1 ] && info "Compiling questionnaire with solutions." || info "Compiling chapter $chapter with solutions."
[ $DEBUG -eq 1 ] && make pdf || make pdf >> $SINK 2>&1
rename "with_solutions" $chapter
elif [ $mode = "spacing" ]
then
echo "\spacingtrue" > $TOGGLEFILE
[ $ANNOTATE -eq 1 ] && do_annotate
[ "$#" -eq 1 ] && info "Compiling questionnaire with space for your solutions." || info "Compiling chapter $chapter with space for your solutions."
[ $DEBUG -eq 1 ] && make pdf || make pdf >> $SINK 2>&1
rename "with_spacing" $chapter
@ -73,6 +83,7 @@ compile_file() {
compile_simple_file() {
[ "$#" -eq 0 ] && info "Compiling whole questionnaire." || info "Compiling chapter $1 from the questionnaire."
echo "" > $TOGGLEFILE
[ $ANNOTATE -eq 1 ] && do_annotate
[ $DEBUG -eq 1 ] && make all || make all >> $SINK 2>&1
rename $1
}
@ -92,7 +103,8 @@ compile_wrapper() {
}
compile_chapter() {
for chapter in one two three four five six seven eight nine ten eleven
#for chapter in smtzthree proplogic satsolver ndpred predlogic ndpred smt bdd eqchecking symbenc temporal
for chapter in bdd satsolver
do
set_chapter "\\chapter${chapter}true"
compile_wrapper "$chapter" "$@"

BIN
figures/computation_tree.png

After

Width: 1108  |  Height: 592  |  Size: 48 KiB

BIN
figures/kripke5.png

After

Width: 400  |  Height: 403  |  Size: 21 KiB

68
main.tex

@ -8,6 +8,7 @@
\input{util/styling_macros}
\input{util/constants}
\input{util/chapter}
\input{util/tcolorbox}
\pagestyle{fancy}
@ -30,7 +31,6 @@
\makeatother
\newcounter{beforeCounter}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
@ -57,82 +57,28 @@
\clearpage
\ifchapterone
\ifchapterproplogic
\setsectionnum{0}
\section{SMT Solvers and Z3}
\input{smt_and_z3/smt_and_z3.tex}
\pagebreak
\fi
\ifchaptertwo
\setsectionnum{1}
\section{Propositional Logic}
\input{propositional_logic/propositional_logic.tex}
\input{propositional_logic/propositional_logic.tex}
\pagebreak
\fi
\ifchapterthree
\setsectionnum{2}
\ifchaptersatsolver
\setsectionnum{1}
\section{SAT Solvers}
\input{sat_solvers_dpll/sat_solvers_dpll.tex}
\pagebreak
\fi
\ifchapterfour
\setsectionnum{3}
\section{Natural Deduction for Propositional Logic}
\input{natural_deduction_propositional_logic/natural_deduction_prop_logic.tex}
\pagebreak
\fi
\ifchapterfive
\setsectionnum{4}
\section{Predicate Logic}
\input{predicate_logic/predicate_logic.tex}
\pagebreak
\fi
\ifchaptersix
\setsectionnum{5}
\section{Natural Deduction for Predicate Logic}
\input{natural_deduction_predicate_logic/natural_deduction_predicate_logic.tex}
\pagebreak
\fi
\ifchapterseven
\setsectionnum{6}
\section{Satisfiability Modulo Theories}
\input{smt/smt.tex}
\pagebreak
\fi
\ifchaptereight
\setsectionnum{7}
\ifchapterbdd
\setsectionnum{2}
\section{Binary Decision Diagrams}
\input{bdds/bdds.tex}
\pagebreak
\fi
\ifchapternine
\setsectionnum{8}
\section{Combinational Equivalence Checking}
\input{equivalence_checking/equivalence_checking.tex}
\pagebreak
\fi
\ifchapterten
\setsectionnum{9}
\section{Symbolic Encoding}
\input{symbolic_encoding/symbolic_encoding.tex}
\pagebreak
\fi
\ifchaptereleven
\setsectionnum{10}
\section{Temporal Logic}
\input{temporal_logic/temporal_logic.tex}
\pagebreak
\fi
%---------------------------------------------------------

2
no_solution.tex

@ -1 +1 @@
There is no solution available for this question yet.
\textit{There is no solution available for this question yet.}

9
propositional_logic/0001.tex

@ -0,0 +1,9 @@
\item \lect Look at the following statements and tick them if they are true.
\begin{itemize}
\item[$\square$] "\textit{Give me the butter}." is a declarative sentence.
\item[$\square$] Questions are always declarative sentences.
\item[$\square$] Declarative sentences can be true and false at the same time.
\item[$\square$] "\textit{My best friend is staying overnight.}" is a declarative sentence.
\end{itemize}

9
propositional_logic/0001_sol.tex

@ -0,0 +1,9 @@
\item \lect Look at the following statements and tick them if they are true.
\begin{itemize}
\item[$\square$] "\textit{Give me the butter}." is a declarative sentence.
\item[$\square$] Questions are always declarative sentences.
\item[$\square$] Declarative sentences can be true and false at the same time.
\item[$\ticked$] "\textit{My best friend is staying overnight.}" is a declarative sentence.
\end{itemize}

7
propositional_logic/0002.tex

@ -0,0 +1,7 @@
\item \lect Model the following sentences as detailed as possible in propositional logic.
\begin{enumerate}
\item Alice will either take the bike or the tram to get to the concert, not both.
\item Students will have to take an exam at the end of the semester.
\item If he is hungry and the fridge is not empty, he cooks for himself.
\end{enumerate}

14
propositional_logic/0002_sol.tex

@ -0,0 +1,14 @@
\begin{enumerate}
\item $p:$ \quad Alice will take the bike to get to the concert.
$q:$ \quad Alice will take the tram to get to the concert.
$$ (p \land \lnot q) \lor (\lnot p \land q) $$
\item $p:$ \quad Students will have to take an exam at the end of the semester.
$$ p $$
\item $p:$ \quad He is hungry.
$q:$ \quad The fridge is empty.
$r:$ \quad He cooks for himself.
$$ p \land \lnot q \imp r $$
\end{enumerate}

7
propositional_logic/0003.tex

@ -0,0 +1,7 @@
\item \lect Model the following sentences as detailed as possible in propositional logic.
\begin{enumerate}
\item If the air temperature is above 30°C, then the water temperature is above 20°C and I am able to go for a swim.
\item Your kid will be safe if and only if it learns to swim.
\item What time is it?
\end{enumerate}

13
propositional_logic/0003_sol.tex

@ -0,0 +1,13 @@
\begin{enumerate}
\item $p:$ \quad The air temperature is above 30°C.
$q:$ \quad The water temperature is above 20°C.
$r:$ \quad I am able to go for a swim.
$$ p \imp q \land r $$
\item $p:$ \quad Your kid will be safe.
$q:$ \quad Your kid learns to swim.
$$ p \leftrightarrow q $$
\item This is not a declarative sentence.
\end{enumerate}

1
propositional_logic/0004.tex

@ -0,0 +1 @@
\item \lect Give the definition of well-formed formulas in propositional logic. \\

5
propositional_logic/0004_sol.tex

@ -0,0 +1,5 @@
We give the definition of well-formed formulas in propositional logic
using a grammar in Backus-Naur form (BNF) as:
%
$$\varphi \coloneqq ~ < \text{atomic proposition>} ~ | ~\varphi \wedge \varphi~ |~ \varphi \vee \varphi~ | ~\neg \varphi ~| ~\varphi \imp \varphi~ | ~\varphi \leftrightarrow \varphi~ | ~( \varphi )$$

5
propositional_logic/0004_sol.tex~

@ -0,0 +1,5 @@
We give the definition of well-formed formulas in propositional logic
using a grammar in Backus-Naur form (BNF) as:
%
$$\varphi \coloneqq ~ < \text{atomic proposition>} ~ | ~\varphi \wedge \varphi~ |~ \varphi \vee \varphi~ | ~\neg \varphi ~| ~\varphi \imp \varphi~ | ~\varphi \leftrightarrow \varphi~ | ~( \varphi )$$

10
propositional_logic/0005.tex

@ -0,0 +1,10 @@
\item \lect Let $p, q$ and $r$ be a atomic propositions. Tick all statements that are true.
\begin{itemize}
\item[$\square$] "$\lnot p \land \lor \enspace q$" is a propositional formula.
\item[$\square$] "$(p \land q) \lor (r \imp p)$" is a propositional formula.
\item[$\square$] "$\lnot p$" is a propositional formula.
\item[$\square$] "$\lor$" is a propositional formula.
\item[$\square$] "$p$" is a propositional formula.
\end{itemize}

9
propositional_logic/0005_sol.tex

@ -0,0 +1,9 @@
\item \lect Let $p, q$ and $r$ be a atomic propositions. Tick all statements that are true.
\begin{itemize}
\item[$\square$] "$\lnot p \land \lor \enspace q$" is a propositional formula.
\item[$\ticked$] "$(p \land q) \lor (r \imp p)$" is a propositional formula.
\item[$\ticked$] "$\lnot p$" is a propositional formula.
\item[$\square$] "$\lor$" is a propositional formula.
\item[$\ticked$] "$p$" is a propositional formula.
\end{itemize}

2
propositional_logic/0006.tex

@ -0,0 +1,2 @@
\item \lect Determine whether the string $\neg (a \vee \neg \neg b)$ is a well-formed formula using the parse
tree. Explain your answer.

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save