Understanding the order of unification in a given query

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Understanding the order of unification in a given query



Consider the following query ?- B=A+1, A=C, C=B-1.


?- B=A+1, A=C, C=B-1



Prolog, in this case, outputs :


B=B-1+1,
A=C, C=B-1.



Why is that? i would expect C = B-1+1-1 or C = A + 1 -1.
What is the order of he unification? how prolog deals with such query?


C = B-1+1-1


C = A + 1 -1









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

C++ virtual function: Base class function is called instead of derived