def prop_all_even(self): '''Idempotence of implies(f) ''' return forall( self.evens, is_even, )
def prop_all_included(self): t = implies(lambda i: i < self.depth, int) vals = values(self.depth, t) return forall( int, lambda i: i in vals if i < self.depth else True, )
def prop_all_lists_are_sorted(): return forall(List[int], is_sorted)
def prop_nested(): return speccer.forall(List[int], lambda xs: speccer.forall(int, lambda y: y in xs))
def prop_all_contained(self): vals = values(self.depth, self.evens) return forall( implies(lambda i: i < self.depth, int), lambda i: i in vals if is_even(i) else True, )