def from_fp(self, file_pointer, comment_lead=['c']):
        """
            Read a CNF+ formula from a file pointer. A file pointer should be
            specified as an argument. The only default argument is
            ``comment_lead``, which can be used for parsing specific comment
            lines.

            :param file_pointer: a file pointer to read the formula from.
            :param comment_lead: a list of characters leading comment lines

            :type file_pointer: file pointer
            :type comment_lead: list(str)

            Usage example:

            .. code-block:: python

                >>> with open('some-file.cnf+', 'r') as fp:
                ...     cnf1 = CNFPlus()
                ...     cnf1.from_fp(fp)
                >>>
                >>> with open('another-file.cnf+', 'r') as fp:
                ...     cnf2 = CNFPlus(from_fp=fp)
        """

        self.nv = 0
        self.clauses = []
        self.atmosts = []
        self.comments = []
        comment_lead = tuple('p') + tuple(comment_lead)

        for line in file_pointer:
            line = line.strip()
            if line:
                if line[0] not in comment_lead:
                    if line[-1] == '0':  # normal clause
                        cl = [int(l) for l in line.split()[:-1]]
                        self.nv = max([abs(l) for l in cl] + [self.nv])

                        self.clauses.append(cl)
                    else:  # atmost/atleast constraint
                        items = [i for i in line.split()]
                        lits = [int(l) for l in items[:-2]]
                        rhs = int(items[-1])
                        self.nv = max([abs(l) for l in lits] + [self.nv])

                        if items[-2][0] == '>':
                            lits = list(map(lambda l: -l, lits))
                            rhs = len(lits) - rhs

                        self.atmosts.append([lits, rhs])
                elif not line.startswith('p cnf+ '):
                    self.comments.append(line)
Read a CNF+ formula from a file pointer. A file pointer should be
            specified as an argument. The only default argument is
            ``comment_lead``, which can be used for parsing specific comment
            lines.

            :param file_pointer: a file pointer to read the formula from.
            :param comment_lead: a list of characters leading comment lines

            :type file_pointer: file pointer
            :type comment_lead: list(str)

            Usage example:

            .. code-block:: python

                >>> with open('some-file.cnf+', 'r') as fp:
                ...     cnf1 = CNFPlus()
                ...     cnf1.from_fp(fp)
                >>>
                >>> with open('another-file.cnf+', 'r') as fp:
                ...     cnf2 = CNFPlus(from_fp=fp)