'self = (\x.(walk x), (subj -o f))
arg  = (john        ,  subj)
returns ((walk john),          f)'

def applyto(self, arg):

    if (self.indices & arg.indices):
        raise linearlogic.LinearLogicApplicationException((u"'%s'    applied    to    '%s'.        Indices    are    not    disjoint." % (self, arg)))
    else:
        return_indices = (self.indices | arg.indices)
    try:
        return_glue = linearlogic.ApplicationExpression(self.glue, arg.glue, arg.indices)
    except linearlogic.LinearLogicApplicationException:
        raise linearlogic.LinearLogicApplicationException((u"'%s'    applied    to    '%s'" % (self.simplify(), arg.simplify())))
    arg_meaning_abstracted = arg.meaning
    if return_indices:
        for dep in self.glue.simplify().antecedent.dependencies[::(-1)]:
            arg_meaning_abstracted = self.make_LambdaExpression(Variable((u'v%s' % dep)), arg_meaning_abstracted)
    return_meaning = self.meaning.applyto(arg_meaning_abstracted)
    return self.__class__(return_meaning, return_glue, return_indices)
