%======================================================================= % % Handshaking across a table (everybody shaking): % Is enumerated by EIS A001147, but aerated (0,1,0,3,0,15,0,105,0,945,0,10395,...) % because we get no solutions when there are odd number of shakers. % % See also: % % http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A001147 % http://www.research.att.com/~njas/sequences/a002694.gif % http://www.iki.fi/~kartturi/matikka/ModFin/A001147.fnd % % http://arp.anu.edu.au/~jks/finder.html % % Actually, in this case we could manage with just one bijective % function f, with no need for relation e. (Both encode same % thing.) % See http://www.iki.fi/~kartturi/matikka/ModFin/A000108A.fnd % % %========================================================================== sort { ELEM cardinality = 12 } function { e: ELEM,ELEM -> bool. f: ELEM -> ELEM { cut } } clause { e(x,x) -> FALSE. % No self-handshakings. e(x,y) -> e(y,x). % Symmetric, if x shakes with y, then vice versa also. y=z; FALSE = e(x,y); FALSE = e(x,z). % Each shakes with exactly one other person. e(x,f(x)). % Everybody shakes hands with somebody else. } setting { verbosity stats: full stack: maximal } end