abdce8c1afd15564e4ec74791b653df1628a4880
[ker1415-1.git] / report / ass2.tex
1 \subsection{Implementation of the hitting-set algorithm}
2 \subsubsection{Task 12: Generate conflict}
3 \begin{listing}[H]
4 \caption{Generating conflict sets}
5 \prologcode{./src/task12.pl}
6 \end{listing}
7
8
9 \subsubsection{Task 13: Define your data structure}
10 \begin{listing}[H]
11 \caption{Hitting set datastructure}
12 \prologcode{./src/hs.pl}
13 \end{listing}
14 % Het doel van deze opdracht was om je datastructure te laten zien, je hebt
15 % alleen gezegd wat voor bomen geen hitting set kunnen zijn...
16
17 %Our datastructure uses the predicate node to signify nodes and leaf for leaves. A node contains a list of edge labels and another list (with the same length as the amound of edge labels) that contains nodes or leaves. The edge label corresponds with its order in the list it is in.
18 %Good examples:
19 %isHittingSetTree(node([a,b],[leaf,leaf])).
20 %isHittingSetTree(node([a,b], [node([c,d], [leaf,leaf]), node([e,f], [leaf,leaf])])).
21 %isHittingSetTree(node([a,b], [node([c,d], [node([g,h,i], [leaf,leaf,leaf]),leaf]), node([a,f], [leaf,leaf])])).
22 %
23 %Wrong examples:
24 %
25 %isHittingSetTree(node([a,b], [node([c,d], [node([g,h], [leaf,leaf,leaf]),leaf]), node([a,f], [leaf,leaf])])).
26
27 \subsubsection{Task 14: Implementation}