def most_general_unification(a, b, bindings=None):
 if (bindings is None):
  bindings = BindingDict()
 if (a == b):
  return bindings
 elif isinstance(a, IndividualVariableExpression):
  return _mgu_var(a, b, bindings)
 elif isinstance(b, IndividualVariableExpression):
  return _mgu_var(b, a, bindings)
 elif (isinstance(a, ApplicationExpression) and isinstance(b, ApplicationExpression)):
  return (most_general_unification(a.function, b.function, bindings) + most_general_unification(a.argument, b.argument, bindings))
 raise BindingException((a, b))

def most_general_unification ( a , b , bindings = None ) : if ( bindings is None ) : bindings = BindingDict ( ) if ( a == b ) : return bindings elif isinstance ( a , IndividualVariableExpression ) : return _mgu_var ( a , b , bindings ) elif isinstance ( b , IndividualVariableExpression ) : return _mgu_var ( b , a , bindings ) elif ( isinstance ( a , ApplicationExpression ) and isinstance ( b , ApplicationExpression ) ) : return ( most_general_unification ( a . function , b . function , bindings ) + most_general_unification ( a . argument , b . argument , bindings ) ) raise BindingException ( ( a , b ) )
find the most general unification of the two given expressions .