Help and How-To :

Creating a User Defined Function

User Defined Functions are the same as any other rule, except the user defines parameters with a special notation. The system will not search for a variable beginning with “_” (underscore). Instead, the user must pass the value to use as a parameter.

Definition:
product(_x,_y) := _x * _y

The user may call product anytime the rule is available:
product(4,5) will return 20;
product(3,2) will return 6.