# Path: tensorlog/util.py
# def memusage():
# def linesIn(fileLike):


import os.path
import logging
from tensorlog import util
                      % (functor,arity,i,typeName,self._type[i][key])
      assert False, errorMsg
    self._type[i][key] = typeName
    if typeName not in self._stab:
      self._stab[typeName] = self._safeSymbTab()

  def serialize(self,direc):
    """Save info needed to deserialize this object in appropriately named
    file in the given directory
    """
    with open(os.path.join(direc,'typed-symbols.txt'), 'w') as fp:
      self.serializeTo(fp)

  def serializeTo(self,fp):
    for decl in self._declarations:
      fp.write(decl + '\n')
    for i in range(2):
      for (functor,arity) in self._type[i]:
        fp.write('\t'.join([str(i),functor,str(arity),self._type[i][(functor,arity)]]) + '\n')
    for typeName in self.getTypes():
      fp.write('\n' + typeName + '\n')
      for i in range(1,self.getMaxId(typeName)+1):
        fp.write(self.getSymbol(typeName,i) + '\n')

  @staticmethod
  def deserializeFrom(fileLike):
    result = TypedSchema()
    readingTypeDecs = True
    currentType = None
    k = -1

# Path: tensorlog/util.py
# def memusage():
# def linesIn(fileLike):


# Path: tensorlog/dbschema.py
import os.path
import logging
from tensorlog import util

                      % (functor,arity,i,typeName,self._type[i][key])
      assert False, errorMsg
    self._type[i][key] = typeName
    if typeName not in self._stab:
      self._stab[typeName] = self._safeSymbTab()

  def serialize(self,direc):
    """Save info needed to deserialize this object in appropriately named
    file in the given directory
    """
    with open(os.path.join(direc,'typed-symbols.txt'), 'w') as fp:
      self.serializeTo(fp)

  def serializeTo(self,fp):
    for decl in self._declarations:
      fp.write(decl + '\n')
    for i in range(2):
      for (functor,arity) in self._type[i]:
        fp.write('\t'.join([str(i),functor,str(arity),self._type[i][(functor,arity)]]) + '\n')
    for typeName in self.getTypes():
      fp.write('\n' + typeName + '\n')
      for i in range(1,self.getMaxId(typeName)+1):
        fp.write(self.getSymbol(typeName,i) + '\n')

  @staticmethod
  def deserializeFrom(fileLike):
    result = TypedSchema()
    readingTypeDecs = True
    currentType = None
    k = -1

    for line in util.linesIn(fileLike):