In reply to szy0014:
The constraint solver recognizes certain builtin SystemVerilog functions as mathematical expressions and expands them into the constraint equations. It cannot do that with user defined functions. (well, the LRM does not currently define a way to do that)