I am trying to write my on mod function in Prolog, with a signature of modulo(A,B,C), where C is equivalent to A mod B. This is my code:
modulo(A,B,A) :- A<B. /* Not sure about this part.*/
modulo(A,B,C) :-
A==C ->
true ;
A>C ->
A1 is A-B,
modulo(A1,B,C) ;
false .
For some reason, when I run this code, it gives me an "Arguments are not sufficiently instantiated" error. I am very new to Prolog, and I was wondering if someone could please help me figure out what I am doing wrong/how to fix it?
Any help would be greatly appreciated! Thank you in advance!