'what is the results of the below prolog code?

Let M denote a list. Write Prolog procedures to do the following: (a) count(Q,W,E): Count the number of occurrences of Q in M to give the result E. (b) delete_all(Q,E,M1): Delete all occurrences of Q from M to give the result M1. (c) replace_all(Q,M,Y,M1): Replace all occurrences of Q with Y to give the result M1.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source