code: def check_input(prolog_file):
      '''
      Check for illegal predicates (like reading/writing, opening sockets, etc).
      '''
      if prolog_file == None:
          return
      for pred in illegal_predicates:
          if type(pred) == tuple:
              print_name = pred[1]
              pred = pred[0]
          else:
              print_name = pred
          if re.search(r'[^\w]' + pred + r'\s*[\(\)\:\.\,\;]+', prolog_file):
              raise Exception('Illegal predicate "%s" used in your input, aborting. If your own predicate clashes with a predefined YAP predicate, you must rename it.' % print_namef check_input(prolog_file):
      '''
      Check for illegal predicates (like reading/writing, opening sockets, etc).
      '''
      if prolog_file == None:
          return
      for pred in illegal_predicates:
          if type(pred) == tuple:
              print_name = pred[1]
              pred = pred[0]
          else:
              print_name = pred
          if re.search(r'[^\w]' + pred + r'\s*[\(\)\:\.\,\;]+', prolog_file):
              raise Exception('Illegal predicate "%s" used in your input, aborting. If your own predicate clashes with a predefined YAP predicate, you must rename it.' % print_name)
docs: Check for illegal predicates (like reading/writing, opening sockets, etc).