CNF Converter/CNFConverter.py
def distributivity(clause1,clause2): 
	""" Function to distribute OR over AND """
	if isinstance(clause1, list) and clause1[0] == AND:
		output = [AND, distributivity(clause1[1],clause2), distributivity(clause1[2],clause2)]
	elif  isinstance(clause2, list) and clause2[0] == AND:
		output = [AND, distributivity(clause1,clause2[1]), distributivity(clause1,clause2[2])]
	else :
		output = [OR, clause1, clause2]
	return output
 Function to distribute OR over AND 
Function to distribute OR over AND
Function to distribute OR over AND
def distributivity(clause1,clause2): 
	if isinstance(clause1, list) and clause1[0] == AND:
		output = [AND, distributivity(clause1[1],clause2), distributivity(clause1[2],clause2)]
	elif  isinstance(clause2, list) and clause2[0] == AND:
		output = [AND, distributivity(clause1,clause2[1]), distributivity(clause1,clause2[2])]
	else :
		output = [OR, clause1, clause2]
	return output
def distributivity ( clause1 , clause2 ) : if isinstance ( clause1 , list ) and clause1 [ 0 ] == AND : output = [ AND , distributivity ( clause1 [ 1 ] , clause2 ) , distributivity ( clause1 [ 2 ] , clause2 ) ] elif isinstance ( clause2 , list ) and clause2 [ 0 ] == AND : output = [ AND , distributivity ( clause1 , clause2 [ 1 ] ) , distributivity ( clause1 , clause2 [ 2 ] ) ] else : output = [ OR , clause1 , clause2 ] return output
Function to distribute OR over AND
Function to distribute OR over AND
""" Function to distribute OR over AND """
clause1
clause2