| … | … | @@ -119,4 +119,42 @@ Obviously, the above can be replaced by "any" query at all. The current |
| 119 | 119 | rules seem to require explicit variable declarations, so that the types |
| 120 | 120 | become visible for item (1). |
| 121 | 121 | |
| 122 | | For item (3), |
| 122 | For item (3), the `'left-wildcard` method takes a single `ITEM` and |
| 123 | returns |
| 124 | ``` |
| 125 | (Edge (Predicate "word-pair") |
| 126 | (List (Any "left-wild") ITEM)) |
| 127 | ``` |
| 128 | The obvious "solution" is to replace this with |
| 129 | ``` |
| 130 | (Edge (Predicate "word-pair") |
| 131 | (List (Variable "$left") ITEM)) |
| 132 | ``` |
| 133 | The preceeding questions need to be "is this really needed?" and "what |
| 134 | is this used for?" The answer seems to be is that these are used for |
| 135 | storing marginals, only. |
| 136 | |
| 137 | This then begs the question: "what do we want, for marginals"? Ther are |
| 138 | several plausible answers. Consider the general tensor query: |
| 139 | ``` |
| 140 | (Query |
| 141 | (VariableList VAR-1 VAR-2 ... VAR-N) |
| 142 | (AndLink PATTERN-TERM-1 PATTERN-TERM-2 ... PATTERN-TERM-K) |
| 143 | REWRITE-1 |
| 144 | REWRITE-2 |
| 145 | ... |
| 146 | REWRITE-M |
| 147 | ``` |
| 148 | One answer is to claim that one wants marginals for the search pattern, |
| 149 | given by the `AndLink`. For N=2 variables, call them 'left' and 'right', |
| 150 | there are only two marginals, obtained by plugging into search pattern. |
| 151 | For larger N, there are N-factorial marginals. |
| 152 | |
| 153 | In this case, one asks "what's the point of the rewrites?". The answer |
| 154 | here is that we actually want marginals on the rewrites, and not on the |
| 155 | search pattern. For N=2 and M=1 we regain the original word-pair matrix. |
| 156 | In that original matrix, the only rewrite was identical to the search |
| 157 | pattern, thus a confusion about which is which. |
| 158 | |
| 159 | The rewrites provide an opportunity to specify exactly which marginals |
| 160 | one is interested in. Thus, for example: |