# $Id$
# A quantifier to help state assertions over finite sequences
def allIntsIn(seq, pred):
"""type: sequence(int) -> (int -> bool)
Ensures: result is True just when for each int i in seq, pred(i) is true.
Note that ranges are sequences of ints"""
for i in seq:
if not pred(i):
return False
return True