-\r
-generateHittingSetTree(SD, COMP, OBS, HS, T) :- %test with problem1(SD,COMP,OBS), generateHittingSetTree(SD,COMP,OBS,[],T). This needs to report node([a1], [node([a2], [leaf])]).\r
- (\r
- tp(SD, COMP, OBS, HS, CS) -> %finds a conflict set\r
- generateParts(SD, COMP, OBS, HS, [], T) ; generateParts(SD, COMP, OBS, HS, CS, T) %first part of the OR is needed to translate an empty conflict set into a leaf.\r
- ).\r
- \r
-generateParts(SD, COMP, OBS, HS, [],leaf).%generates leaf if at the end of all possible conflict sets in a branch\r
-generateParts(SD, COMP, OBS, HS, CS, node(CS, TS)) :- %generates node if the conflict set isn't empty and goes on.\r
- repairBranch(SD, COMP, OBS, HS, CS, TS). %repairs the branch by branching out for each item in the conflict set\r
+generateHittingSetTree(SD, COMP, OBS, HS, HSTREE) :- %test with problem1(SD,COMP,OBS), generateHittingSetTree(SD,COMP,OBS,[],T). This needs to report node([a1], [node([a2], [leaf])]).\r
+ tp(SD, COMP, OBS, HS, CS) -> generateParts(SD, COMP, OBS, HS, CS, HSTREE) ; generateParts(_, _, _, _, [], HSTREE). %second part of the OR is needed to translate an empty conflict set into a leaf. \r
+ \r
+generateParts(_,_,_,_, [],leaf).%generates leaf if at the end of all possible conflict sets in a branch\r
+generateParts(SD, COMP, OBS, HS, CS, node(CS, RESTOFTREE)) :- %generates node if the conflict set isn't empty and goes on.\r
+ repairBranch(SD, COMP, OBS, HS, CS, RESTOFTREE). %repairs the branch by branching out for each item in the conflict set and generating new conflict sets for the next node\r