Example #1
0
 def prop_all_even(self):
     '''Idempotence of implies(f)
     '''
     return forall(
         self.evens,
         is_even,
     )
Example #2
0
 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,
     )
Example #3
0
def prop_all_lists_are_sorted():
    return forall(List[int], is_sorted)
Example #4
0
def prop_nested():
    return speccer.forall(List[int],
                          lambda xs: speccer.forall(int,
                                                    lambda y: y in xs))
Example #5
0
 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,
     )
Example #6
0
def prop_nested():
    return speccer.forall(List[int],
                          lambda xs: speccer.forall(int, lambda y: y in xs))