factors = [factor for factor in working_factors[var]
if not set(factor.variables).intersection(eliminated_variables)]
phi = factor_product(*factors)
phi.reduce("{variable}_0".format(variable=var))
cliques.add(tuple(phi.scope()))
del working_factors[var]
for variable in phi.variables:
After Change
if len(elimination_order) < len(self.variables):
raise ValueError("Elimination order incomplete")
// If the elimination_order list is incomplete, raise an error
if set(elimination_order) != set(self.variables):
raise ValueError("Set of variables in elimination "
"order different from variables in model")