CNF Converter/CNFConverter.py
def associativity(input):
	""" Function to associate OR and OR, AND and AND """
	if is_symbol(input):			# check if its a symbol then return as it is
		return input
	elif input[0] in [AND,OR]:
		temp1=[]
		temp2=[]
		for index in range(1,len(input)):
			if input[0] == input[index][0]:
				temp1.extend(input[index][1:])
				temp2.append(input[index])
		for element in temp2:
			input.remove(element)
		input.extend(temp1)
		return input
	else:
		return input
 Function to associate OR and OR, AND and AND 
Function to associate OR and OR, AND and AND
Function to associate OR and OR AND and AND
def associativity(input):
	if is_symbol(input):			
		return input
	elif input[0] in [AND,OR]:
		temp1=[]
		temp2=[]
		for index in range(1,len(input)):
			if input[0] == input[index][0]:
				temp1.extend(input[index][1:])
				temp2.append(input[index])
		for element in temp2:
			input.remove(element)
		input.extend(temp1)
		return input
	else:
		return input
def associativity ( input ) : if is_symbol ( input ) : return input elif input [ 0 ] in [ AND , OR ] : temp1 = [ ] temp2 = [ ] for index in range ( 1 , len ( input ) ) : if input [ 0 ] == input [ index ] [ 0 ] : temp1 . extend ( input [ index ] [ 1 : ] ) temp2 . append ( input [ index ] ) for element in temp2 : input . remove ( element ) input . extend ( temp1 ) return input else : return input
Function to associate OR and OR, AND and AND
Function to associate OR and OR AND and AND
""" Function to associate OR and OR, AND and AND """ # check if its a symbol then return as it is

input