Repository navigation
docs(compliance): state the representative-object policy for a feature with no stated multiplicity - #1550
Merged
Conversation
…e with no stated multiplicity Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…ill read an assumed 1..1 into an unstated multiplicity Co-Authored-By: jason.han <hanhuijun@gmail.com>
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
Documentation only. The KerML default multiplicity is
0..*for counting, conformance, SMT bounds and query plans, but the runtime keeps a policy the compliance map did not yet state: a feature that states and inherits no multiplicity and holds no value materializes one representative object, a declared[0..*]materializes none, and no count is judged against the defaulted feature (EffectiveFeature.MultiplicityDefaultedininternal/exec/runtime/shape.go). The maintainer accepted that policy; this PR records it as a row ofdocs/project/spec-compliance.md.0..*literally for the representative instance is not an option. Statusruntime/shape.gofeatureRange/representativeRange/EffectiveFeature.MultiplicityDefaulted,runtime/instance.gocheckAdmits,runtime/write_conformance.gowriteTargetIn, and the tests that pin it: conformancemultiplicity_default_kerml,robustness_default_multiplicity_test.go:TestRuntimeRobustnessDefaultMultiplicity(all four subtests),instance_test.go:TestInstantiate_UnboundedDefaultIsNotAScalar, conformancemultiplicity_unbounded_single_bound.[1]it carries for a bareattribute u;; that reading contradicts the default-multiplicity row, so it now says what the[1]is — the representative one value of the new row — with no clause claimed for it. The behaviour it pins (undetermined_test.go,[1]foru) is unchanged.changes/unreleased/representative-object-policy.changed.md.Second commit — the remaining claims on the page that described an unstated multiplicity as the specification's assumed
1..1, each verified againstwrite_conformance.gowriteTargetIn,checkTargetHeld,checkWriteandshape.gofeatureRange/statedMultiplicityondevelop0286c9845with a throwaway write probe (an action-def-owned attribute written by its own body throughexecuteActionSource, and a part-def-owned attribute written by its nested action through the execution-conformance harness; both probes removed before committing):1..1(KerML 1.1 §7.3.4.2) unless …" → judged against what it states or inherits and the implicit[1..1]where §7.6.3 declares it; one stating and inheriting none has the0..*default. The probe shows the write side honours that on one path and not the other, and the row now says so instead of claiming the fix(runtime): default an undeclared feature multiplicity to 0..* per KerML §7.4.12 #1542 semantics throughout:attribute x : Real :> many;on a part def written(3.0, 4.0)by its nested action holds both values (Instance.SetFeatureValue→checkAdmits, which judges no count whereMultiplicityDefaulted); the same declaration on an action def written by the action's own body is refused withmultiplicity upper bound 1(ActionExecutor.setFeature→mirrorOccurrence→Instance.SetFeatureValue→Context.checkWrite, which passescountJudged = trueunconditionally, so the representative1..1is judged;writeTargetInitself reportscountJudged = falsefor it).attribute z : Real;on a part def (implicit[1..1]) still refuses two, as it should. The row's status staysContext.checkWriteshould consult the target'scountJudged/the feature'sMultiplicityDefaultedascheckAdmitsdoes.1..1" / "exactly one value" claim about an unstated multiplicity remains on the page, and the page no longer namesAssumedRangeat all; the remaining "exactly one" rows are the implicit[1..1], operands declared[1]and the one result of an invocation (KerML §7.4.9), which are clauses, not the default.No code, test, fixture or baseline changes.
ErrNoValuewording from the merged unbound-result change is untouched and consistent (an instantiated object holding no required value is still<unset>/ErrNoValuewhen used; the new row is about the count of objects materialized, not the value a data-typed feature holds).Specification basis
0..*is "the usual default" (binary association ends excepted).[1..1]under its three conditions.Behaviour the row states, checked by hand on this build (
bin/sysml -e):class C { feature x : Real = (1.0, 2.0); } feature c : C;→K::cInstance(ID: 1)(oneC)K::c.x[1.0, 2.0]feature cs : C[0..*];→K::cs[]part def Q { attribute k : Real = 3.0; } part pr : Q;→P::pr/P::pr.kInstance(ID: 1)/3.0part p0 : Q[0..*];→P::p0/P::p0.k[]/[]part p2 : Q[2];→P::p2.k[3.0, 3.0]attribute u : Real;→P::u<undetermined>How it was verified
Doc gates on this branch:
Dry-merges in detached worktrees (
changelog.py check,doc-counts -check,check-doc-links.pyon each merged tree):origin/develop(0286c9845) + this branch: clean; changelog ok, doc-counts current, the new row present once.fix/excluding-at-library-body(87d56706d) + this branch: clean; changelog ok, doc-counts current.chore/pilot-pin-2026-09(9ca600a59): this branch's one commit does not apply to that head — the conflict is the default-multiplicity row, which chore(pilot): pin the OMG pilot implementation to release 2026-09 (0.63.0) #1529's head still carries in its pre-0..*wording (developitself conflicts with chore(pilot): pin the OMG pilot implementation to release 2026-09 (0.63.0) #1529 onspec-compliance.mdandvalidation-constraints.mdfor the same reason, anddoc-counts -checkalready fails on chore(pilot): pin the OMG pilot implementation to release 2026-09 (0.63.0) #1529's bare head at line 2509). Once chore(pilot): pin the OMG pilot implementation to release 2026-09 (0.63.0) #1529 re-mergesdevelopthe hunk is the one this branch edits ondevelop, which merges clean as above. On a fresh worktreecheck-doc-links.pyreports one broken link to the generateddocs/assets/landing/libavoid-js.LICENSE.txton every tree including baredevelop; it is a build artefact, not a link this change touches.Checklist
make testandmake lintpass locally (docs-only;go build,go vet,gofmtclean,go test ./...as above)changes/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/7c671f5178ec48acad2a65f195a7d82c
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/7c671f5178ec48acad2a65f195a7d82c?variant=devin
Requested by: @HuiJun