-
Notifications
You must be signed in to change notification settings - Fork 5
Unified iteration of TSC and TSCInstance. #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request unifies the iteration interface for TSC (Timed Scenario Constraint) and TSCInstance by making TSCInstance implement Iterable<TSCInstanceNode>. The changes enable consistent iteration patterns across both TSC and TSCInstance objects, replacing the previous traverse() method with the standard iterator interface.
Key Changes
- Made
TSCInstanceimplementIterable<TSCInstanceNode>with a newTSCInstanceIteratorclass - Updated
generateAllInstances()to returnList<TSCInstance>instead ofList<TSCInstanceNode> - Simplified metric code by replacing
traverse()calls withfilter()on iterable TSCInstance objects
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
TSCNode.kt |
Updated generateAllInstances() return type signature |
TSCBoundedNode.kt |
Updated implementation to wrap nodes in TSCInstance and extract rootNode for edges |
TSCInstanceIterator.kt |
New iterator class for depth-first traversal of TSCInstance nodes |
TSCInstance.kt |
Made class implement Iterable<TSCInstanceNode> with iterator and toString methods |
TSC.kt |
Updated buffer types to store TSCInstance instead of TSCInstanceNode |
MissedPredicatesPerTSCMetric.kt |
Replaced traverse() with filter() on iterable TSCInstance |
MissedPredicateCombinationsPerTSCMetric.kt |
Replaced traverse() with filter() on iterable TSCInstance |
ValidTSCInstancesPerTSCMetric.kt |
Updated equality check to use full TSCInstance comparison |
MissedTSCInstancesPerTSCMetric.kt |
Simplified implementation using list-based tracking instead of map-based flags |
InvalidTSCInstancesPerTSCMetric.kt |
Updated equality check to use full TSCInstance comparison |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...e/src/main/kotlin/tools/aqua/stars/core/metrics/evaluation/MissedTSCInstancesPerTSCMetric.kt
Show resolved
Hide resolved
.../src/main/kotlin/tools/aqua/stars/core/metrics/evaluation/InvalidTSCInstancesPerTSCMetric.kt
Show resolved
Hide resolved
...re/src/main/kotlin/tools/aqua/stars/core/metrics/evaluation/ValidTSCInstancesPerTSCMetric.kt
Show resolved
Hide resolved
stars-core/src/main/kotlin/tools/aqua/stars/core/tsc/instance/TSCInstanceIterator.kt
Outdated
Show resolved
Hide resolved
stars-core/src/main/kotlin/tools/aqua/stars/core/tsc/instance/TSCInstanceIterator.kt
Show resolved
Hide resolved
...e/src/main/kotlin/tools/aqua/stars/core/metrics/evaluation/MissedTSCInstancesPerTSCMetric.kt
Show resolved
Hide resolved
stars-core/src/main/kotlin/tools/aqua/stars/core/tsc/node/TSCNode.kt
Outdated
Show resolved
Hide resolved
stars-core/src/main/kotlin/tools/aqua/stars/core/tsc/instance/TSCInstance.kt
Fixed
Show fixed
Hide fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...tlin/tools/aqua/stars/core/metrics/postEvaluation/MissedPredicateCombinationsPerTSCMetric.kt
Outdated
Show resolved
Hide resolved
...tlin/tools/aqua/stars/core/metrics/postEvaluation/MissedPredicateCombinationsPerTSCMetric.kt
Show resolved
Hide resolved
stars-core/src/main/kotlin/tools/aqua/stars/core/tsc/instance/TSCInstance.kt
Outdated
Show resolved
Hide resolved
...src/main/kotlin/tools/aqua/stars/core/metrics/postEvaluation/MissedPredicatesPerTSCMetric.kt
Outdated
Show resolved
Hide resolved
...src/main/kotlin/tools/aqua/stars/core/metrics/postEvaluation/MissedPredicatesPerTSCMetric.kt
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.