Corrected bug in strongGeneratingSetGiven by rewriting the function in functional style.