Procedure from library linalg.lib (see linalg_lib).
linalg.lib
diag_test(A); A = const square matrix
int, 1 if A is diagonalisable, 0 if not -1 no statement is possible, since A does not split.
The test works only for split matrices, i.e if eigenvalues of A are in the ground field. Does not work with parameters (uses factorize,gcd).
Example:
LIB "linalg.lib"; ring r=0,(x),dp; matrix A[4][4]=6,0,0,0,0,0,6,0,0,6,0,0,0,0,0,6; print(A); diag_test(A);