Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/unreleased/docs-audit-examples.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- The example walkthroughs under `examples/` again show what the pinned binaries print: a calculation or analysis result held in its effective multiplicity (`fuelUsed = [120.0]`, `= [6432.955324716369 [SI::'m/s']]`), the `(N independent)` choice-point counts and the `order-dependent` marker on a value a schedule decides, the current Mermaid frontmatter and one-line container titles, the `%features` listing of a completed state machine, the instance IDs a session allocates, and the figures of the check engine, `-render-all` and the stdlib conformance gate. `lander_demo.py` and `robot_demo.py` read the one-element sequences the `opensysml` client now returns instead of failing to format them, `examples/README.md` lists `general-views-demo/`, and the general-views walkthrough names the `name-conflict` warning its model prints.
18 changes: 9 additions & 9 deletions examples/EXPRESSIONS-DEMO.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ over. `square` and `halve` are usages of the `Square` and `Halve` definitions;

```
✓ Squared(3.0)
= 9.0
= [9.0]
✓ Halved(3.0)
= 1.5
= [1.5]
✓ Apply(halve, 9.0)
= 4.5
= [4.5]
```

Reading a calculation on its own answers the function, named by its
Expand Down Expand Up @@ -210,7 +210,7 @@ function:
```

```
Instance: ExpressionsDemo::Amplifier (ID: 13)
Instance: ExpressionsDemo::Amplifier (ID: 9)
Features:
gain = 1.5
transfer = ExpressionsDemo::Amplifier::amplify
Expand Down Expand Up @@ -240,11 +240,11 @@ equal, and so are their `elements`.
```

```
Instance: ExpressionsDemo::RadioBands (ID: 14)
Instance: ExpressionsDemo::RadioBands (ID: 10)
Features:
requested = Instance(ID: 15)
requested = Instance(ID: 11)
elements = Set{"Ka", "S", "X"}
licensed = Instance(ID: 16)
licensed = Instance(ID: 12)
elements = Set{"Ka", "S", "X"}
distinctBands = 3
sameBands = true
Expand All @@ -270,7 +270,7 @@ dimension, and the arithmetic keeps the shape component by component:
```

```
Instance: ExpressionsDemo::MountStress (ID: 17)
Instance: ExpressionsDemo::MountStress (ID: 13)
Features:
field = Tensor(2, 2, 2)[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] [Pa]
rank = 3
Expand Down Expand Up @@ -300,7 +300,7 @@ in i : Instrument; i.mass }` is a `MassValue[0..*]` and can be declared as one
```

```
Instance: ExpressionsDemo::MassRollup (ID: 19)
Instance: ExpressionsDemo::MassRollup (ID: 15)
Features:
instruments = [Instance(ID: 2), Instance(ID: 4), Instance(ID: 3)]
mass = 4.0 [kg]
Expand Down
39 changes: 17 additions & 22 deletions examples/PARSER_FEATURES_DEMOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Demonstrations of the SysML v2 / KerML parser features that let every file of th

## Overview

These demos showcase parser improvements across multiple development sessions (Sessions 2-5). Each demo file focuses on a specific category of features with working examples extracted from real stdlib usage patterns.
Each demo file focuses on a specific category of features with working examples extracted from real stdlib usage patterns.

**Parser Status:** 96/96 bundled library files parse cleanly (94 official SysML v2 standard library files plus two OpenSysML extensions), gated by `internal/workspace/libs/stdlib_conformance_test.go`.
**Parser Status:** every bundled library file — the official SysML v2 standard library plus the libraries under `OpenSysML Libraries/` — parses cleanly, gated by `internal/workspace/libs/stdlib_conformance_test.go`; the measured count lives in [the gate table of the roadmap](../docs/project/roadmap.md#where-the-repository-stands) (Stdlib parser conformance).

## Demo Files

### Original Demos (Sessions 2-3)
### Original Demos

#### 1. Relationships Demo (`parser_features_demo_relationships.kerml`)

Expand Down Expand Up @@ -81,7 +81,7 @@ demo 6, `parser_features_demo_advanced_connectors.kerml`.
- Alternative to `=` for value assignment
- Clearer intent for default values

### Advanced Demos (Sessions 4-5)
### Advanced Demos

#### 6. Advanced Connectors Demo (`parser_features_demo_advanced_connectors.kerml`)

Expand Down Expand Up @@ -258,38 +258,33 @@ go test ./examples -run '^TestParserFeaturesDeclarations$' -v
go test ./examples -run '^TestParserFeaturesEdgeCases$' -v
```

## Development Context
## Feature Summary

These features were implemented across five development sessions:
### Original features
- inverse of, unions, protected/readonly, nonunique, default keyword, binding syntax, constant modifier, succession first/then, chains relationship, connection connect keyword

### Sessions 2-3 (Tasks 47-57)
- **Coverage:** 76.8% → 81.1% (+4.3pp, +4 files)
- **Features:** inverse of, unions, protected/readonly, nonunique, default keyword, binding syntax, constant modifier, succession first/then, chains relationship, connection connect keyword
### Advanced features
- Connector enhancements (end modifiers, references, single-end typing, transition usage)
- Action semantics (assign, perform, while, if, namespace succession)
- Advanced bodies (predicate/bool returns, shorthand params, constraint members)
- Messages & events (message/event keywords, ref with body)
- Declarations (multiplicity, classifier/subclassifier, multiple typing, subset/disjoint)
- Edge cases (keywords in expressions, identifier multiplicities, bind/require/step shortcuts)

### Sessions 4-5 (Tasks 58-94)
- **Coverage:** 81.1% → 100.0% (+18.9pp, +18 files)
- **Features:** 37 tasks implementing all remaining stdlib patterns
- Connector enhancements (end modifiers, references, single-end typing, transition usage)
- Action semantics (assign, perform, while, if, namespace succession)
- Advanced bodies (predicate/bool returns, shorthand params, constraint members)
- Messages & events (message/event keywords, ref with body)
- Declarations (multiplicity, classifier/subclassifier, multiple typing, subset/disjoint)
- Edge cases (keywords in expressions, identifier multiplicities, bind/require/step shortcuts)

**Final Status:** 100.0% (96/96 bundled library files parse cleanly)
**Status:** every bundled library file parses cleanly (`go test -run TestStdlibConformance ./internal/workspace/libs`); the count is kept in [the roadmap's gate table](../docs/project/roadmap.md#where-the-repository-stands).

## Real-World Usage

These patterns appear throughout the official standard library:

**Original features (Sessions 2-3):**
**Original features:**
- Base.kerml: chains relationship, visibility modifiers
- Occurrences.kerml: inverse of, succession patterns
- Interfaces.sysml: protected references, nonunique ports
- ShapeItems.sysml: complex binding patterns, connection with connect
- CausationConnections.sysml: named succession with first/then

**Advanced features (Sessions 4-5):**
**Advanced features:**
- Actions.sysml: action semantics, namespace succession, transition usage
- Flows.sysml: message/event keywords, ref with body
- Base.kerml: multiplicity declarations, classifier keyword
Expand Down
6 changes: 5 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Each of these is a model and a walkthrough of the commands that exercise it.
| [solver-demo.sysml](solver-demo.sysml) | [SOLVER-DEMO.md](SOLVER-DEMO.md) | `%check`, `%explain`, `%solve`, `%configure` and `%optimize` — what conditions *can* hold, which conflict, what satisfies them, which variants are permitted, what is best (needs z3 or cvc5) |
| [oosem-demo/oosem-demo.sysml](oosem-demo/oosem-demo.sysml) | [oosem-demo/README.md](oosem-demo/README.md) | the `OOSEM` library on a small Earth-observation mission: as-is and to-be enterprise, causal analysis, stakeholder needs derived down to component requirements with `#moe`/`#mop`, the black-box system context and its use case, the logical scenario and components, and the physical architecture distributed over nodes |
| [mosa-demo/mosa-demo.sysml](mosa-demo/mosa-demo.sysml) | [mosa-demo/README.md](mosa-demo/README.md) | the `MOSA` library on a modular ground vehicle: the major system platform, its major system components and a modular autonomy system, the modular system interfaces between them (one written as `#keyInterface`), the consensus standards they conform to, data rights and proprietary elements, interface control, MOSA requirements with their traces, a conformance assessment, the MOSA views and a generated interface control document; `-validate` reports the openness gaps the model leaves on purpose |
| [general-views-demo/](general-views-demo/) | [general-views-demo/README.md](general-views-demo/README.md) | `GeneralView`s drawn as graphs: a requirement graph with satisfy, verify, derive and refine edges, coloured by verification verdict with `-render-overlay verdicts`; a definition-and-usage graph; a package graph; and the use case diagrams a `filter @SysML::UseCaseUsage` view is drawn as |
| [views-demo.sysml](views-demo.sysml) | [VIEWS-DEMO.md](VIEWS-DEMO.md) | `%view` and `%render` — the seven rendering kinds, the text/Mermaid/Markdown forms, viewpoint conformance and filtered exposure |
| [expressions-demo.sysml](expressions-demo.sysml) | [EXPRESSIONS-DEMO.md](EXPRESSIONS-DEMO.md) | the expression forms worked through one payload: `as` casts that select rather than convert, `*` as the unbounded value, `.metadata` on an annotated part, calculations passed and invoked as function values, a `Set` with no order and no repeats, a rank-three tensor quantity indexed and scaled, and `collect`/`select`/`reduce` bodies typed by what they return |
| [action-executor-demo.sysml](action-executor-demo.sysml) | [ACTION-EXECUTOR-DEMO.md](ACTION-EXECUTOR-DEMO.md) | executing actions, and stepping one in the REPL |
Expand All @@ -57,7 +58,10 @@ in [checking](../docs/guide/05-checking.md), and
[rdf-interop-demo.sysml](rdf-interop-demo.sysml) — structure only, so it round-trips — in
[saving and RDF](../docs/guide/07-saving-and-rdf.md).
[phase-c-behavioral-bodies.sysml](phase-c-behavioral-bodies.sysml) exercises the
calculation, constraint, requirement, action and state bodies the parser accepts, and
calculation, constraint, requirement, action and state bodies the parser accepts,
[gridview-relationship-matrix.sysml](gridview-relationship-matrix.sysml) is the `GridView`
relationship matrix the [view rendering forms](../docs/project/view-rendering-forms.md) record
describes, and
[runtime-demo/](runtime-demo/) is a Go program (`go run ./examples/runtime-demo`) that
drives the parser, resolver and runtime directly rather than through `sysml`.

Expand Down
1 change: 1 addition & 0 deletions examples/SOLVER-DEMO.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ exceed its own budget, so it cannot hold:
```

```
✗ Requirement OverbookedBudget is unsatisfiable (z3, 9ms)
✗ Requirement OverbookedBudget is unsatisfiable: 3 conditions conflict (z3, 26ms)
Every condition below is needed: dropping any one leaves the rest satisfiable.
1. required condition: `rover.drivePower + rover.sciencePower <= 200` — requirement OverbookedBudget, at …:65:13
Expand Down
26 changes: 11 additions & 15 deletions examples/VIEWS-DEMO.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,22 +185,20 @@ config:
…
flowchart:
subGraphTitleMargin:
bottom: 48
bottom: 24
---
%% LanderViews::descentFlow — action rendering (view def ActionFlowView)
%% not represented: 2 fork/join name(s) (split, sync); Mermaid's fork bar draws no label
%% not represented: 2 pin(s) not drawn (Lander::Descend.fuel, burn.propellant); a flowchart draws the pins an edge ends at
flowchart TD
subgraph n0 ["`*«action def»*
**Descend**`"]
subgraph n0 ["`*«action def»* **Descend**`"]
direction TD
n1@{ shape: f-circ, label: "" }
n2("`*«action»*
**deployParachute**`")
subgraph n3 ["`*«action»*
**burn**
subgraph n3 ["`*«action»* **burn**
own flow`"]
direction TD
n3_anchor[" "]
…
end
n4 --> n5
Expand All @@ -209,10 +207,11 @@ own flow`"]
…
```

The leading frontmatter carries the theme and reserves the height of a cluster
title's second and third lines, which Mermaid would otherwise draw under the
first child. The `%% not represented` lines name what the text form shows and
the diagram cannot: the names of fork and join bars, and pins no edge ends at.
The leading frontmatter carries the theme and, because `burn`'s title still
spans two lines (its `own flow` note), reserves the height of a cluster title's
second line, which Mermaid would otherwise draw under the first child. The
`%% not represented` line names what the text form shows and the diagram
cannot: the names of fork and join bars.

```
%render LanderViews::partsTable markdown
Expand Down Expand Up @@ -243,11 +242,8 @@ reaches only what carries the `Safety` metadata:
```
LanderViews::safetyView - tree rendering (the view states no rendering; a tree is the default)

part def Lander::Thruster
attribute thrust : Real
item fuelIn : Fuel
port supply : FuelPort
part def Lander::Parachute
part def Thruster
part def Parachute
```

## Rendering without the REPL
Expand Down
Loading
Loading