def variable_from_literal(literal, DIMACS = False):
    """Breaks down a literal into a variable and a flag for negation"""

    if not DIMACS:
        assert literal not in ["0","1"], 'Trying to find the underlying variable of "0" or "1"'

    if literal[0] == "-":
        variable = literal[1:]
        negated = True
    else:
        variable = literal
        negated = False

    return (variable, negated)