reasoning with constraints def __str__(self)return self name def __repr__(self)return self name "variable({self name})constraints constraint consists ofa tuple (or listof variables is called the scope condition is boolean function that takes the same number of arguments as there are variables in the scope the condition must have __name__ property that gives printable name of the functionbuilt-in functions and functions that are defined using def have such propertyfor other functions you may need to define this property an optional name an optional (xyposition cspproblem py -(continued class constraint(object)""" constraint consists of scopea tuple of variables conditiona boolean function that can applied to tuple of values for variables in scope stringa string for printing the constraints all of the strings must be unique for the variables ""def __init__(selfscopeconditionstring=noneposition=none)self scope scope self condition condition if string is noneself string self condition __name__ str(self scopeelseself string string self position position def __repr__(self)return self string an assignment is variable:value dictionary if con is constraintcon holds(assignmentreturns true or false depending on whether the condition is true or false for that assignment the assignment assignment must assigns value to every variable in the scope of the constraint con (and could also assign values other variables)con holds gives an error if version june