projog

3.88. pj_add_arithmetic_operator(X,Y) - defines a Java class as an arithmetic operator.

X represents the name and arity of the predicate. Y represents the full class name of an implementation of org.projog.core.ArithmeticOperator.

Examples

?- X is sum(1, 1).

Cannot find arithmetic operator: sum/2

?- pj_add_arithmetic_operator(sum/2, 'org.projog.core.math.builtin.Add').

yes

?- X is sum(1, 1).
X = 2

yes