verilog: support recursive functions using ternary expressions