Where clauses do not apply to the LHS of exclusive rules when no RHS exists

Issue #23 resolved
Sean Kauffman repo owner created an issue

This was the real issue from the previous bug that I closed as invalid. The problem is that the where clause is not evaluated unless there is a RHS to evaluate against. When the RHS does not exist, that is, one has not been seen, there is no filtering applied and so any restrictions pertaining to the LHS are not respected.

The following rule exhibits the problem:

C :- B unless after A where B.begin < 30

Comments (3)

  1. Sean Kauffman reporter

    This is tricky, since the RHS can also be involved in where expressions which filter what intervals are excluded, so you can’t just pass NULLs to the expression evaluation for the RHS and assume semantic analysis has kept you safe. The solution may require breaking up where expressions into separate parts – not great bob.

  2. Sean Kauffman reporter

    Fix issue #23. The solution, here, is to implement the workaround via static analysis. The left hand side of exclusive rules is broken out as an atomic rule where any filtering expressions are then mapped to it using the existing machinery. The only thing that should be improved here (apart from testing) is that this could be optimized to not break out the rule if there's no filter expression on the lhs.

    → <<cset 4f8756a4f67d>>

  3. Log in to comment