code: def check_non_equality_explicit_constraints(self,safe_variables,query):
          ''' Checking variables which occur in explicit constraints with non equality
          operators '''
          # Create a list of variables which occur in explicit constraints with non
          # equality operators
          variables_in_constraints_with_non_equality_operators = \
              [y for x in query.constraints \
                 for y in [x.get_left_side(), x.get_right_side()] \
                 if y.is_variable() and not x.is_equality_constraint()]
  
          for variable in variables_in_constraints_with_non_equality_operators:
              if not (variable in safe_variables):
                  raise NotSafeException('Query not safe because ' + \
                      variable.name + \
                      ' from a non_equality comparison does not occur in a positive goal')
                  return False
  
          return Truf check_non_equality_explicit_constraints(self,safe_variables,query):
          ''' Checking variables which occur in explicit constraints with non equality
          operators '''
          # Create a list of variables which occur in explicit constraints with non
          # equality operators
          variables_in_constraints_with_non_equality_operators = \
              [y for x in query.constraints \
                 for y in [x.get_left_side(), x.get_right_side()] \
                 if y.is_variable() and not x.is_equality_constraint()]
  
          for variable in variables_in_constraints_with_non_equality_operators:
              if not (variable in safe_variables):
                  raise NotSafeException('Query not safe because ' + \
                      variable.name + \
                      ' from a non_equality comparison does not occur in a positive goal')
                  return False
  
          return True
docs: Checking variables which occur in explicit constraints with non equality
          operators