run_phc := proc(p::list)
  description `calls /tmp/phc from Maple 6 session`:
  local i,n,sp,semcol,sr,infile,outfile,solfile,cmd1,cmd2,sols:
  n := nops(p):             # number of polynomials
  semcol := `;`:
  sr := convert(rand(),string):
  infile := input||sr:      # randomized file names
  outfile := output||sr:
  solfile := sols||sr:
  fopen(infile,WRITE):
  fprintf(infile,`%d\n`,n):
  for i from 1 to n do
    sp := convert(p[i],string):
    sp := ` `||sp||semcol:  # append semicolon
    fprintf(infile,`%s\n`,sp):
  od:
  fclose(infile):
  cmd1 := `/tmp/phc -b `||infile||` `||outfile:
  cmd2 := `/tmp/phc -z `||outfile||` `||solfile:
  ssystem(cmd1):
  ssystem(cmd2):
  read(solfile): sols := %:
  fremove(infile):
  fremove(outfile):
  fremove(solfile):
  RETURN(sols);
end proc:
