|
For each of the following patterns and instances, say whether the instance matches the pattern and, if so, give the corresponding matcher.
| (a) | p(X,Y) and p(a,a) | |
| | {X←a, Y←a} | |
| | No match | |
| |
| (b) | p(X,Y) and p(a,f(a)) | |
| | {X←a, Y←f(a)} | |
| | No match | |
| |
| (c) | p(X,f(Y)) and p(a,f(a))| | |
| | {X←a, Y←a} | |
| | No match | |
| |
| (d) | p(X,X) and p(2,min(2,4)) | |
| | {X←2} | |
| | No match | |
| |
| (d) | p(X,min(2,4)) and p(2,2) | |
| | {X←2} | |
| | No match | |
|