def Zebra():
Colors = '<STR_LIT>'.split()<EOL>Pets = '<STR_LIT>'.split()<EOL>Drinks = '<STR_LIT>'.split()<EOL>Countries = '<STR_LIT>'.split()<EOL>Smokes = '<STR_LIT>'.split()<EOL>vars = Colors + Pets + Drinks + Countries + Smokes<EOL>domains = {}<EOL>for var in vars:<EOL><INDENT>domains[var] = list(range(<NUM_LIT:1>, <NUM_LIT:6>))<EOL><DEDENT>domains['<STR_LIT>'] = [<NUM_LIT:1>]<EOL>domains['<STR_LIT>'] = [<NUM_LIT:3>]<EOL>neighbors = parse_neighbors("""<STR_LIT>""", vars)<EOL>for type in [Colors, Pets, Drinks, Countries, Smokes]:<EOL><INDENT>for A in type:<EOL><INDENT>for B in type:<EOL><INDENT>if A != B:<EOL><INDENT>if B not in neighbors[A]: neighbors[A].append(B)<EOL>if A not in neighbors[B]: neighbors[B].append(A)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>def zebra_constraint(A, a, B, b, recurse=<NUM_LIT:0>):<EOL><INDENT>same = (a == b)<EOL>next_to = abs(a - b) == <NUM_LIT:1><EOL>if A == '<STR_LIT>' and B == '<STR_LIT>': return same<EOL>if A == '<STR_LIT>' and B == '<STR_LIT>': return same<EOL>if A == '<STR_LIT>' and B == '<STR_LIT>': return next_to<EOL>if A == '<STR_LIT>' and B == '<STR_LIT>': return next_to<EOL>if A == '<STR_LIT>' and B == '<STR_LIT>': return same<EOL>if A == '<STR_LIT>' and B == '<STR_LIT>': return same<EOL>if A == '<STR_LIT>' and B == '<STR_LIT>': return same<EOL>if A == '<STR_LIT>' and B == '<STR_LIT>': return same<EOL>if A == '<STR_LIT>' and B == '<STR_LIT>': return same<EOL>if A == '<STR_LIT>' and B == '<STR_LIT>': return next_to<EOL>if A == '<STR_LIT>' and B == '<STR_LIT>': return same<EOL>if A == '<STR_LIT>' and B == '<STR_LIT>': return (a - <NUM_LIT:1>) == b<EOL>if recurse == <NUM_LIT:0>: return zebra_constraint(B, b, A, a, <NUM_LIT:1>)<EOL>if ((A in Colors and B in Colors) or<EOL>(A in Pets and B in Pets) or<EOL>(A in Drinks and B in Drinks) or<EOL>(A in Countries and B in Countries) or<EOL>(A in Smokes and B in Smokes)): return not same<EOL>raise '<STR_LIT:error>'<EOL><DEDENT>return CSP(vars, domains, neighbors, zebra_constraint)<EOL>
Return an instance of the Zebra Puzzle.