code: def tt_check_all(kb, alpha, symbols, model):
      "Auxiliary routine to implement tt_entails."
      if not symbols:
          if pl_true(kb, model):
              result = pl_true(alpha, model)
              assert result in (True, False)
              return result
          else:
              return True
      else:
          P, rest = symbols[0], symbols[1:]
          return (tt_check_all(kb, alpha, rest, extend(model, P, True)) and
                  tt_check_all(kb, alpha, rest, extend(model, P, False))f tt_check_all(kb, alpha, symbols, model):
      "Auxiliary routine to implement tt_entails."
      if not symbols:
          if pl_true(kb, model):
              result = pl_true(alpha, model)
              assert result in (True, False)
              return result
          else:
              return True
      else:
          P, rest = symbols[0], symbols[1:]
          return (tt_check_all(kb, alpha, rest, extend(model, P, True)) and
                  tt_check_all(kb, alpha, rest, extend(model, P, False)))
docs: Auxiliary routine to implement tt_entails.