I have an assignment to write a prolog code to add, multiply, subtract and divide complex numbers. However, I'm not sure how to portray imaginary numbers in prolog!
kompl_mul(komplex(A1,B1),komplex(A2,B2),komplex(A,B)) :-
A is A1*A2 - B1*B2,
B is A1*B2 - A2*B1.
This is how I would start off with the multiplication rule, but how do I implement a+bi? How can I show that B is bi?
Thanks so much for the help!