Skip to main content

judge.accept

judge.accept(evaluations, dependents)

The acceptance rule accept/1.

A candidate is accepted if and only if its evaluations have no failure, no error and at least one pass, and no dependent fails. Unit tests are not an argument: they never affect acceptance. That a final module exists is the caller’s condition.

Parameters

Name Type Description Default
evaluations Tally The counts of the evaluations of the attempt that produced the final module. required
dependents Tally The counts of the dependents of that module. required

Returns

Name Type Description
bool bool Whether the candidate is accepted.

Examples

from babregen.judge import Tally, accept

print(accept(Tally(2, 0, 0), Tally(1, 0, 0)))
print(accept(Tally(2, 0, 0), Tally(0, 1, 0)))
print(accept(Tally(0, 0, 0), Tally(0, 0, 0)))
True
False
False