def read_logic(s, logic_parser=None, encoding=None):
    if encoding is not None:
        s = s.decode(encoding)
    if logic_parser is None:
        logic_parser = LogicParser()

    statements = []
    for linenum, line in enumerate(s.splitlines()):
        line = line.strip()
        if line.startswith('#') or line=='': continue
        try:
            statements.append(logic_parser.parse(line))
        except LogicalExpressionException:
            raise ValueError('Unable to parse line %s: %s' % (linenum, line))
    return statements
Convert a file of First Order Formulas into a list of {Expression}s.
dataset/ETHPy150Open nltk/nltk/nltk/sem/logic.py/read_logic