#
# atomic(L) returns true or false according to whether the lattice L
#  is atomic; i.e., whether every element is the join of atoms.
# The procedure does *not* test whether L is a lattice.
# The criterion: L is atomic iff atoms are the only elements that
# cover only one element.
#
`posets/atomic`:=proc(L) local X,x,cov;
  X:=map(op,L); cov:=`posets/coversets`(L,X);
  for x in X do
    if nops(cov[x])=1 and cov[cov[x][1]]<>{} then RETURN(false) fi
  od; true
end:
#
save `posets/atomic`, cat(HomeLib,`/posets/atomic.m`);
read cat(HomeLib,`/help/posets/atomic`);
quit;

