propositions and inference for cl in self clauses_for_atom(selectedfor ass in self prove_all_ass(cl body+ans_body[ :],assumedunion of answers for each clause with head=selected elseempty body return [assumedone answer def conflicts(self)"""returns list of minimal conflicts""return minsets(self prove_all_ass(['false'])given list of setsminsets returns list of the minimal sets in the list for exampleminsets([{ }{ }{ }{ }{ }]returns [{ }{ }logicassumables py -(continued def minsets(ls)"""ls is list of sets returns list of minimal sets in ls ""ans [elements known to be minimal for in lsif not any( < for in lsand not any( < for in ans)ans append(creturn ans minsets([{ }{ }{ }{ }{ }]warningminsets works for list of sets or for set of (frozensetsbut it does not work for generator of sets for exampletry to predict and then testminsets( for in [{ }{ }{ }{ }{ }]the diagnoses can be constructed from the (minimalconflicts as follows this also works if there are non-minimal conflictsbut is not as efficient logicassumables py -(continued def diagnoses(cons)"""cons is list of (minimalconflicts returns list of diagnoses ""if cons =[]return [set()elsereturn minsets([({ }|dis set union for in cons[ for in diagnoses(cons[ :])]test caseslogicassumables py -(continued electa kba(clause('light_l ')version june