dom_intersect1(List1,List2,Res) :-
(is_list(List1); is_list(List2)), !,
dom_intersect1_list(List1,List2,Res).
dom_intersect1(one_of(List1),one_of(List2),one_of(Res)) :-
!, dom_intersect_one_ofs(List1,List2,Res).
dom_intersect1(one_of(List),X,one_of(Res)) :-
!,dom_intersect_one_of_with_elem(List,X,Res).
dom_intersect1(X,one_of(List),one_of(Res)) :-
!, dom_intersect_one_of_with_elem(List,X,Res).
dom_intersect1(and(List),X,Res) :- !,
dom_intersect(List,L),
dom_intersect1(L,X,Res).
dom_intersect1(X,and(List),Res) :- !,
dom_intersect(List,L),
dom_intersect1(L,X,Res).
dom_intersect1(X,X,X) :- !.
dom_intersect1(X,any,X) :- spec_predicate(X,_).
dom_intersect1(any,X,X) :- spec_predicate(X,_).
dom_intersect1(X,Y,A) :-
(spec_indirection(X,IndX) -> true ; IndX = X),
(spec_indirection(Y,IndY) -> true ; IndY = Y),
(X \= IndX; Y \= IndY),!,
dom_intersect1(IndX,IndY,A).
dom_intersect1(X,Y,X) :- dom_super(X,Y), !.
dom_intersect1(Y,X,X) :- dom_super(X,Y), !.
dom_intersect1(X,Y,X) :-
dom_super(X,ParentX),
spec_predicate(Y,_),
dom_intersect1(ParentX,Y,ParentX), !.
dom_intersect1(Y,X,X) :-
dom_super(X,ParentX),
spec_predicate(Y,_),
dom_intersect1(ParentX,Y,ParentX), !.
dom_intersect1(tuple(X),tuple(Y),tuple(A)) :- !,
dom_intersect1(X,Y,A).
dom_intersect1(list(X),list(Y),list(A)) :- !,
dom_intersect1(X,Y,A).
dom_intersect1(compound(CompX),compound(CompY),compound(CompA)) :- !,
CompX =.. [Fun|X],
CompY =.. [Fun|Y],
dom_intersect1(X,Y,A),
CompA =.. [Fun|A].
dom_intersect1(CompX,CompY,CompA) :-
CompX =.. [Fun|X],
CompY =.. [Fun|Y],!,
dom_intersect1(X,Y,A),
CompA =.. [Fun|A].