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