Combinatorial problem in PROLOG:

A list of facts of the form:

guest([name, sex, age, occupation, [list_of_hobbies],
       political_affiliation, personality_type, [list_of-languages]).

Problem:
   Arrange the seating of guests in a round table, so that following 
constraints are satisfied:

1. alternate man-woman, woman-man.
2. do not seat actors next to professors.
3. do not seat shy persons next to each other.
4. do not seat liberals next to conservatives.
5. age differences of adjacently seated persons should 
   be no more than 10 years.
6.  adjacently seated persons should have at least one hobbie in 
    common, and at least 5 hobbies between them.
7.  adjacently seated persons should have at least 1 language in common.

__________________

seat_next(N1,N2):- guest([N1,S1,A1,O1,H1,P1,T1,L1]),
                   guest([N2,S2,A2,O2,H2,P2,T2,L2]),
                   not(N1=N2),not(S1=S2),
                   (((not(O1=professor),not(O2=actor));((O1=professor),
                    not(O2=actor)); (not(O2=professor),O1=actor))),
                   (((not(O1=conservative),not(O2=liberal));((O1=liberal),
                    not(O2=conservative)); (not(O2=liberal),
                    O1=conservative))),
                   (((T1=shy,not(T2=shy));(not(T1=shy),T2=shy);
                   (not(T1=shy),not(T2=shy))),
                   ((A1>A2,Diff is A1-A2);(Diff is A2-A1)),
                   Diff<10,
                   intersection(H1,H2, Hobies),not(Hobbies=[]),
                   union(H1,H2,Total_hobbies),
                   length(Total_hobbies,Y),Y>=5,
                   intersection(L1,L2,Languages), not(Languages=[]),
                   write(N2),write('can be seated next to'),write(N1),
                   write('.'), fail.