def is_definite_clause(s):
if is_symbol(s.op):<EOL><INDENT>return True<EOL><DEDENT>elif s.op == '<STR_LIT>':<EOL><INDENT>antecedent, consequent = s.args<EOL>return (is_symbol(consequent.op)<EOL>and every(lambda arg: is_symbol(arg.op), conjuncts(antecedent)))<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT>
returns True for exprs s of the form A & B & ... & C ==> D,
    where all literals are positive.  In clause form, this is
    ~A | ~B | ... | ~C | D, where exactly one clause is positive.
    >>> is_definite_clause(expr('Farmer(Mac)'))
    True
    >>> is_definite_clause(expr('~Farmer(Mac)'))
    False
    >>> is_definite_clause(expr('(Farmer(f) & Rabbit(r)) ==> Hates(f, r)'))
    True
    >>> is_definite_clause(expr('(Farmer(f) & ~Rabbit(r)) ==> Hates(f, r)'))
    False
    >>> is_definite_clause(expr('(Farmer(f) | Rabbit(r)) ==> Hates(f, r)'))
    False