Answers to pathology questions
This is the answer to the following question:
A pathological problem
After the two tuples match in one mode, what is the value of the pattern variable $ y constraint:
- Tuples Mode:
- (Ho, $ _, ($ A, $ A), ($ A, $ A, $ B), ($ A, * $ B ))
- Tuples mode B:
Answer
Let's match and combine the members of the two tuples one by one.
- (Ho, $ _, ($ A, $ A) matches with $ X.
Matched successfully:
$ X constraints to (Ho, $ _, ($ A, $ ))
- ($ A, $ A, $ B) matches with $ X.
Because $ X has bound the value above, this matching actually becomes:
($ A, $ A, $ B) matches with (Ho, $ _, ($ A, $)
The following constraints are imposed:
$ A to Ho
$ B to ($ A, $)
$ _ Is an anonymous variable with no value. It cannot constrain other variables or be subject to other variables.
- ($ A, * $ B) matches with $ Y.
Because $ A and $ B already have constraints, this match actually becomes:
(Ho, Ho, Ho) matches with $ y
The following constraints are imposed:
$ Y to (Ho, Ho, Ho)
In short, the matching process completes the constraints of the following values:
$ X to (Ho, $ _, ($ A, $ ))
$ A to Ho
$ B to ($ A, $)
$ Y to (Ho, Ho, Ho)
The conclusion is: $ Y equals (Ho, Ho, Ho ).
Note: If the answer is correct, you should use Pyke.