trap module

This module provide functionality for checking the correctness of witnesses from the forbidden pattern algorithm.

class witnesscheck.WitnessChecker(spec=None, usecheckers=None)[source]

Describes an checker for witnesses. Can be constructed by a string specification and a list of other WitnessChecker.

A WitnessChecker has to implement the protocol:

>>> MyChecker(object):
>>>    def __call__(self, dea, witness):
>>>        raise Exception("...") # if a constraint was violated
>>>        return True # if every constraint was hit

Also __str__ and __repr__ should be implemented for nice printing.

class witnesscheck.alpha(*args)[source]
class witnesscheck.antivalence(*args)[source]
class witnesscheck.composable[source]

Defines the addition operator for building lists: >>> a,b,c = composable(),composable(),composable() >>> a + b + c [ a , b , c]

witnesscheck.generateParser()[source]
class witnesscheck.neq(*args)[source]
witnesscheck.parseSpecification(spec)
class witnesscheck.path(*args)[source]
witnesscheck.t(dea, witness)[source]

This Page