@classmethod
def createFrom(cls, src, force_copy=False, **extra):
    """Create a LogicProgram of the current class from another LogicProgram.

        :param src: logic program to convert
        :type src: :class:`.LogicProgram`
        :param force_copy: default False, If true, always create a copy of the original logic         program.
        :type force_copy: bool
        :param extra: additional arguments passed to all constructors and action functions
        :returns: LogicProgram that is (externally) identical to given one
        :rtype: object of the class on which this method is invoked

        If the original LogicProgram already has the right class and force_copy is False, then         the original program is returned.
        """
    if not force_copy and src.__class__ == cls:
        return src
    else:
        obj = cls(**extra)
        if hasattr(src, 'extra_info'):
            obj.extra_info.update(src.extra_info)
        if hasattr(src, 'source_root'):
            obj.source_root = src.source_root
        if hasattr(src, 'source_files'):
            obj.source_files = src.source_files[:]
            obj.source_parent = src.source_parent[:]
        if hasattr(src, 'line_info'):
            obj.line_info = src.line_info[:]
        obj.add_all(src)
        return obj
