def move_not_inwards(s):
if s.op == '<STR_LIT>':<EOL><INDENT>NOT = lambda b: move_not_inwards(~b)<EOL>a = s.args[<NUM_LIT:0>]<EOL>if a.op == '<STR_LIT>': return move_not_inwards(a.args[<NUM_LIT:0>]) <EOL>if a.op =='<STR_LIT:&>': return associate('<STR_LIT:|>', list(map(NOT, a.args)))<EOL>if a.op =='<STR_LIT:|>': return associate('<STR_LIT:&>', list(map(NOT, a.args)))<EOL>return s<EOL><DEDENT>elif is_symbol(s.op) or not s.args:<EOL><INDENT>return s<EOL><DEDENT>else:<EOL><INDENT>return Expr(s.op, *list(map(move_not_inwards, s.args)))<EOL><DEDENT>
Rewrite sentence s by moving negation sign inward.
    >>> move_not_inwards(~(A | B))
    (~A & ~B)
    >>> move_not_inwards(~(A & B))
    (~A | ~B)
    >>> move_not_inwards(~(~(A | ~B) | ~~C))
    ((A | ~B) & ~C)