#
# chain(n) returns (the cover relation for) an n-element chain.
#
`posets/chain`:=proc(n) local i; 
  if not type(n,'posint') then
    ERROR(`first argument must be a positive integer`)
  elif n=1 then {},1
  else {seq([i,i+1],i=1..n-1)} fi
end:
#
save `posets/chain`, cat(HomeLib,`/posets/chain.m`);
read cat(HomeLib,`/help/posets/chain`);
quit;

