018 pattern path semantics#24
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements semantic validation for the Gram language, introducing a new validation module that enforces pattern and path notation semantics including single definition rules, referential integrity, and consistency checks between mixed notations.
Key Changes:
- Added
Gram.Validatemodule with core validation logic for patterns and paths - Created comprehensive design documentation defining semantic rules (SEMANTICS.md and EXTENDED-SEMANTICS.md)
- Added test suite with 12 test cases covering basic patterns, path notation, and mixed notation validation
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
libs/gram/src/Gram/Validate.hs |
New validation module implementing symbol table, error types, and two-pass validation (registration + checking) |
libs/gram/tests/SemanticsSpec.hs |
New test suite covering basic pattern validation, path notation, and mixed notation consistency |
libs/gram/src/Gram.hs |
Updated module exports to include Gram.Validate (missing Gram.Parse export) |
libs/gram/src/Gram/CST.hs |
Added Ord instance to Identifier type for use in Map keys |
libs/gram/src/Gram/Parse.hs |
Qualified imports for Value types from Subject.Value module to avoid conflicts |
libs/gram/gram.cabal |
Added Gram.Validate module, SemanticsSpec test, and mtl dependency |
design/SEMANTICS.md |
New comprehensive documentation of pattern semantics and fundamental rules |
design/EXTENDED-SEMANTICS.md |
New detailed documentation of pattern-path integration and edge cases |
specs/018-pattern-path-semantics/*.md |
Complete specification files including spec, tasks, research, plan, quickstart, data model, and contracts |
cabal.project.local |
Configuration to enable tests |
.cursor/rules/specify-rules.mdc |
Updated recent changes section with feature reference |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@akollegger I've opened a new pull request, #25, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Andreas Kollegger <akollegger@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Andreas Kollegger <akollegger@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Andreas Kollegger <akollegger@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Andreas Kollegger <akollegger@gmail.com>
Co-authored-by: akollegger <53756+akollegger@users.noreply.github.com>
Update Gram.hs module documentation to include Gram.Validate
|
@akollegger I've opened a new pull request, #26, to work on those changes. Once the pull request is ready, I'll request review from you. |
… definitions from references Co-authored-by: akollegger <53756+akollegger@users.noreply.github.com>
Co-authored-by: akollegger <53756+akollegger@users.noreply.github.com>
Fix path-pattern mixing logic in registerRelationship
|
@akollegger I've opened a new pull request, #27, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Andreas Kollegger <akollegger@gmail.com>
… same source/target nodes Co-authored-by: akollegger <53756+akollegger@users.noreply.github.com>
Co-authored-by: akollegger <53756+akollegger@users.noreply.github.com>
Fix relationship validation to track endpoints for duplicate detection
|
@akollegger I've opened a new pull request, #28, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: akollegger <53756+akollegger@users.noreply.github.com>
Fix quickstart example to use Megaparsec parse function correctly
|
@akollegger I've opened a new pull request, #29, to work on those changes. Once the pull request is ready, I'll request review from you. |
No description provided.