CNF Converter/CNFConverter.py
def eliminate_biconditional(input):
	""" Function to eliminate biconditionals and to replace them with their implication equivalents """
	if is_symbol(input):	# check if its a symbol then return as it is
		return input
	if input[0] in [AND, OR, NOT, IMPLIES]:		# append the clauses to the output if the connective is not a biconditional
		return recursive_call(input,1)
	if input[0]==IFF:		# input - ["iff","A","B"] then convert it to ["and", ["implies","A","B"], ["implies","B","A"]]
		input[0] = AND
		input[1] = [IMPLIES, eliminate_biconditional(input[1]), eliminate_biconditional(input[2])]
		input[2] = [IMPLIES, eliminate_biconditional(input[2]), eliminate_biconditional(input[1])]
		return input
 Function to eliminate biconditionals and to replace them with their implication equivalents 
Function to eliminate biconditionals and to replace them with their implication equivalents
Function to eliminate biconditionals and to replace them with their implication equivalents
def eliminate_biconditional(input):
	if is_symbol(input):	
		return input
	if input[0] in [AND, OR, NOT, IMPLIES]:		
		return recursive_call(input,1)
	if input[0]==IFF:		
		input[0] = AND
		input[1] = [IMPLIES, eliminate_biconditional(input[1]), eliminate_biconditional(input[2])]
		input[2] = [IMPLIES, eliminate_biconditional(input[2]), eliminate_biconditional(input[1])]
		return input
def eliminate_biconditional ( input ) : if is_symbol ( input ) : return input if input [ 0 ] in [ AND , OR , NOT , IMPLIES ] : return recursive_call ( input , 1 ) if input [ 0 ] == IFF : input [ 0 ] = AND input [ 1 ] = [ IMPLIES , eliminate_biconditional ( input [ 1 ] ) , eliminate_biconditional ( input [ 2 ] ) ] input [ 2 ] = [ IMPLIES , eliminate_biconditional ( input [ 2 ] ) , eliminate_biconditional ( input [ 1 ] ) ] return input
Function to eliminate biconditionals and to replace them with their implication equivalents
Function to eliminate biconditionals and to replace them with their implication equivalents
""" Function to eliminate biconditionals and to replace them with their implication equivalents """ # check if its a symbol then return as it is
 # append the clauses to the output if the connective is not a biconditional
 # input - ["iff","A","B"] then convert it to ["and", ["implies","A","B"], ["implies","B","A"]]

input