/* SEL : Utilities for selecting elements from conjunctions */


			% Select and construct

sel(A&Rest,A,B,B&Rest).

sel(X&Rest1,A,B,X&Rest2) :- !, sel(Rest1,A,B,Rest2).

sel(A,A,B,B).



			% Select only

sel(A&Rest,A).

sel(X&Rest,A) :- !, sel(Rest,A).

sel(A,A).


