Test that ?_ cannot be used in text or consequences of a rule.
Chris Pressey
6 years ago
221 | 221 | facts. |
222 | 222 | |
223 | 223 | A special "wildcard" variable, `?_`, matches any term, and does not unify. |
224 | It cannot appear in the text or the consequent of a rule. | |
225 | 224 | |
226 | 225 | scenario UntilHoldBrick { |
227 | 226 | [actor(?_),item(?_)] There was an actor and an item. [~actor(Ignatz)] |
230 | 229 | goal []. |
231 | 230 | } |
232 | 231 | ===> There was an actor and an item. |
232 | ||
233 | `?_` cannot appear in the text or the consequent of a rule. | |
234 | ||
235 | scenario UntilHoldBrick { | |
236 | [actor(?_),item(?_)] There was ?_ and ?_. [~actor(Ignatz)] | |
237 | actor(Ignatz). | |
238 | item(brick). | |
239 | goal []. | |
240 | } | |
241 | ???> KeyError | |
242 | ||
243 | scenario UntilHoldBrick { | |
244 | [actor(?_),item(?_)] There was an actor and an item. [~actor(?_)] | |
245 | actor(Ignatz). | |
246 | item(brick). | |
247 | goal []. | |
248 | } | |
249 | ???> KeyError | |
233 | 250 | |
234 | 251 | The text inside the event rule is typically expanded with the values |
235 | 252 | that the pattern variables matched. |