Repository navigation
fix(semantics): a change trigger binds its in parameter to the FeatureReferenceExpression wrapper whose referent is the condition — the wrapper, its FeatureMembership and result read natively as the conversion writes them - #1817
Merged
Merged
Conversation
…eReferenceExpression wrapper whose referent is the condition — the wrapper, its FeatureMembership and result read natively as the conversion writes them Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…trigger id registration (digest only) Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
3 of 6 tasks
…y-chain-parts Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov> # Conflicts: # docs/project/api-json-differential-baseline.json
… merge (digest only) Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…apper's ownedElement/ownedFeature list the condition it owns The trigger is result-bearing (expressionStructure writes its out), so the change-event branch of expressionPartsOf keeps parts.result and the id reader registers the trigger's out. expressionOwnedParts lists the wrapper's condition ahead of its result, as its FeatureMembership leads; parameter and directedFeature read expressionParameterParts, the parameters alone. Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
… out registration (digest only) Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
6 tasks done
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.
What and why
The third part of the expression-parts parity work (after #1814, #1815, #1816): a change trigger's condition. For
the RDF/API-JSON writer (
changeArgumentininternal/translate/export/rdf_expr.go) states theTriggerInvocationExpressionas owning anin0parameter bound to aFeatureReferenceExpressionargumenta0, whosereferentis the written condition (a > 1, held through aFeatureMembership) and which owns its ownoutresult. The native read owned none of that: the trigger's value had thein0parameter and the condition as a bare operand, no wrapper, soownedMembership,referent, metaclasses and ids disagreed across ledgers.Now the semantics synthesize the wrapper (role
ExpressionChangeWrapper, metaclassFeatureReferenceExpression) as the trigger's single argument, and the condition (roleExpressionChangeCondition) as the wrapper's referent, owned through aFeatureMembershipahead of the wrapper'sReturnParameterMembership. Side tables only — no AST or scope change; the two enum values are appended (the snapshot stores them). The id reader (internal/translate/export/element_ids.go) registersin0,a0,a0.change(the condition, keyed by node and span, with itsFeatureMembershipid) anda0.outas the writer mints them, and recurses into the condition for its own parts.Not in this PR, each as its own follow-up PR: a body expression's parameters/result, and the chain Feature a dotted name owns. A transition's
accept when …payload has no native symbol at all today, so this PR covers the trigger of an accept action; the transition form is a separate gap.Specification basis
SysML v2 1.0 §8.3.16.4
TriggerInvocationExpression(whenform: the argument is aFeatureReferenceExpressionwhose referent is the condition expression, owned through aFeatureMembership), KerML 1.0 §8.3.4.8FeatureReferenceExpression(referent, result parameter). Nospec-compliance.mdrow moves: this is the reflective read agreeing with the conversion, not a new rule.How it was verified
internal/semantic/semantics—TestChangeTriggerOwnsItsConditionThroughAWrapper: metaclasses, the two memberships and their order,referent, nooperatoron the wrapper and>on the condition, the condition's own parameters, repeated-read identity.internal/translate/export—TestElementIDReaderSpellsAChangeTriggerAsTheConversionWritesIt:in0/a0/a0.out, the condition's id andFeatureMembership, and the condition'sin0, all as the conversion writes them.go build ./...,go vet ./...,gofmt -l .(empty),go test -count=1 ./...all green (the four slowest packages re-run alone after a first run under CPU contention timed them out).pilot-apijson-diff -updatethen-checkover this tree — only the writersourceDigestmoved; scorecard unchanged at 1144182 present-equal / 27977 present-different;go -C tools test ./referee/apijson/... ./oracle/baseline/...green.Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/18ad47adf36f44e9b6824a4472f9678d
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/18ad47adf36f44e9b6824a4472f9678d?variant=devin
Requested by: @NicolasRouquette