usemakro("idpot_tools"); Ring:=listprompt("Select a structure", structures); binary_operations:=emptyset; for op in operations(Ring) do if equal(arity(op),2) then additem(binary_operations, op) else noop endif endfor; if >(card(binary_operations),0) then op1:=listprompt("Select a binary operation for +", binary_operations); op2:=listprompt("Select a binary operation for *", binary_operations); write("Idempotent unary polynoms a*x^n+b in <"); write(Ring); write(",");write(op1);write(",");write(op2);writeln(">"); % ONLY UPTO POWER n % for n in card(Ring) do if >(n,0) then for r1 in Ring do for r2 in Ring do poly:=lambda(x) op1(op2(r1,power_op(op2,n,x)),r2) endlambda; if idempotent(poly,Ring) then write("a:=");write(r1);write(" n:=");write(n);write(" b:=");writeln(r2) else noop endif endfor endfor else noop endif endfor else writeln("No binary operations!") endif;