Substitution of an element with another(superficial level) - back to content

		?- subst(new,old,[old,a,old,b,c,old]],R).
		R = [new,a,new,b,c,new]
		?- subst(n,o,[a,b,c,d]],R).
		R = [a,b,c,d]
		?- subst(x,y,[y,y,c,[d,y],e],R).
		R = [x,x,c,[d,y],e]

subst(N,O,[],[]):- !. subst(N,O,[O|T],[N|R]):- subst(N,O,T,R),!. subst(N,O,[X|T],[X|R]):- subst(N,O,T,R).