Consider the assumptions
$Assumptions = {Element[a,Reals], Element[z,Complexes]}
I'm looking for a test, to be applied on a and z, that gives True if the argument is a complex number such as a and False if it's real such as z.
The aim is to use this test in a replacement in this way
set = {a, z, x};
set /. (x_ :> img /; test[x])
(* {a, img, x} *)
An example is
set /. (x_ :> img /; Simplify[NotElement[x, Reals] && Element[x,Complexes]] === (NotElement[x, Reals]))
It is based on the fact that
Simplify[ Element[z,Reals] ]
remain unevaluated.
Is there another possible test that doesn't rest on this (and, possibly, simpler and without If and similar)?

$Assumption, create a list with all real parameters, and after, usingComplement, get a list with the complex parameters. With this list it's easy to create the test function just usingMemberQ– Giancarlo Nov 18 '16 at 03:49$Assumptionshas not changed, only the way it evaluates. You can pull the held form using mystepfunction from http://mathematica.stackexchange.com/a/1447/121 – Mr.Wizard Nov 20 '16 at 18:54