The answer to the question is: yes. A ppdefpattern shows that the test is
just a trailing appendix of the preceding pattern:
(defrule MAIN::related1
(or
(and
(parent ?z ?x)
(parent ?z ?y))
(and
(parent ?x ?y))
(and
(and (parent ?y ?x)
(test
David's expectation of what *should* happen is correct, as is
Wolfgang's of what *is* happening. Looks like a bug.
That said, the bug is in the optimizer that's trying to turn what
David originally had, into what Wolfgang suggests is better. So you
can avoid the bug and improve the code by