コード例 #1
0
def sample(code, budget=0):
    """Beta-eta sample code, ignoring budget."""
    assert isinstance(budget, int) and budget >= 0, budget
    LOG.info('sample({})'.format(pretty(code)))
    head = code
    context = EMPTY_CONTEXT
    for continuation in _sample_nonlinear(head, context):
        yield _close(continuation, nonlinear=True)
コード例 #2
0
def simplify(code):
    """Linearly beta-eta reduce."""
    LOG.info('simplify({})'.format(pretty(code)))
    return _reduce(code, False)
コード例 #3
0
def reduce(code, budget=0):
    """Beta-eta reduce code, ignoring budget."""
    assert isinstance(budget, int) and budget >= 0, budget
    LOG.info('reduce({})'.format(pretty(code)))
    return _reduce(code, True)