docs(compound): guide users to negation workaround for side compounds - #921
Merged
Conversation
Negating a side-tier compound body pattern (e.g. !event(ID, metadata(...))) is rejected at IR conversion because negated side-join lowering is not yet implemented. The expressive power is unaffected: extracting the compound fields in a positive rule and negating the resulting flat relation is fully supported and stratifies naturally. Make that workaround discoverable instead of leaving users stuck on an opaque error: - Extend the IR-conversion error to name the workaround and point at the docs. - Add a "Negation and side compounds" section to docs/COMPOUND_TERMS.md documenting the exact trigger conditions, the unsupported form, and the supported positive-extraction pattern. Behavior is unchanged (the pattern is still rejected); only the log string and documentation change. Existing rejection tests continue to pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Negating a side-tier compound body pattern (e.g.
!event(ID, metadata(...))) is rejected at IR conversion because negated side-join lowering is not yet implemented. This is a narrow limitation — it fires only when all three hold: (1) the atom is negated, (2) the column is a side-tier compound, and (3) the body pattern destructures it with functor syntax. Negating presence (!event(ID, _)), inline compounds, and positive destructuring all work today.Crucially, expressive power is unaffected: extracting the compound fields in a positive rule and negating the resulting flat relation is fully supported and stratifies naturally. This PR makes that workaround discoverable instead of leaving users stuck on an opaque error.
Changes
wirelog/ir/program.c— extend the IR-conversion error message to name the workaround and point at the docs.docs/COMPOUND_TERMS.md— add a "Negation and side compounds" section documenting the exact trigger conditions, the unsupported form, and the supported positive-extraction pattern; link it from the Errors table and TOC.Behavior / risk
Behavior is unchanged — the pattern is still rejected. Only the log string and documentation change.
Testing
meson test wirelog_easy wirelog_advancedpass (includes the negated-side-compound rejection test and side-compound binding tests).sbom_snapshot(dependency-manifest baseline check), which is environmental and unrelated to a log-string + docs change.Follow-up
Full
negated side-join loweringimplementation remains deferred; promote when real demand accumulates or language orthogonality becomes a release goal.