Skip to content

feat(dsl): standard library — movement actions (p7-s5) - #102

Merged
JArmandoAnaya merged 1 commit into
mainfrom
feat/p7-s5-movement-actions
Aug 2, 2026
Merged

feat(dsl): standard library — movement actions (p7-s5)#102
JArmandoAnaya merged 1 commit into
mainfrom
feat/p7-s5-movement-actions

Conversation

@JArmandoAnaya

Copy link
Copy Markdown
Contributor

Slice 43f of #43. §8.8.2–§8.8.4 as bundled DSL source: 15 actions for
movable_object
, 13 for vehicle, walk for person, and the four
enums they use (dynamic_profile, lane_change_side, gap_direction,
headway_direction).

Two bases the standard names but never declares

§8.8.1 gives osc_action exactly two children, action_for_environment and
action_for_movable_object (both landed in 43d). §8.8.3 and §8.8.4 then name
action_for_vehicle and action_for_person in their "Parents" rows, and no
table declares either. §8.8.1's prose supplies them: "Actions for actors that
are children of movable_object, like vehicle or person, inherit from
action_for_movable_object."

Fourteen actions would otherwise have no parent to name, so both are declared
here and their placement is pinned by test.

Judgement calls

Each is recorded in the worksheet with the row that forced it.

  • Mutually exclusive parameters are still plain fields. §8.8.2.4 says "use
    only one of the three possible arguments"; replay_path marks both
    absolute and relative mandatory though only one can be supplied. The
    language has no choice-group construct, and §7.3.11 already lets a scenario
    leave a field unconstrained. Same rule that made every table row a field in
    43b.
  • change_position.target_xyz is marked deprecated in the same row that
    declares it
    , in favour of target_position. Both are declared: there is no
    deprecation marker in the language, and dropping a field the standard prints
    would reject a conforming scenario. Reporting the deprecation belongs to a
    later pass.
  • change_lane.reference documents Default=it.actor. A default naming the
    invoking actor is not a constant expression, so none is declared — the field
    is simply left unconstrained, which is what §7.3.11 already means.
  • The change_*/keep_* gap pairs take different direction enums. A
    change_time_gap takes the six-valued gap_direction; keep_time_gap takes
    the two-valued road_distance_direction (§8.7.22). Carried as printed and
    pinned by TheChangeAndKeepActionsTakeDifferentDirectionEnums, because it
    reads like an oversight and someone will otherwise "fix" it.

Actions and modifiers may share a simple name

change_speed, keep_speed and change_lane are actions here and modifiers in
§8.9. They do not collide: an action's name is a qualified behavior name
(§7.2.2.2.5), so this chapter declares movable_object.change_speed while §8.9
will declare a plain change_speed. AnActionAndAModifierMayShareASimpleName
pins both directions — the qualified name exists, the unqualified one does not
yet — so the next slice cannot blur the distinction.

ADirectionLiteralNeedsItsEnumName covers the other consequence of this
chapter: left is now a member of four enums and ahead of two, so §7.3.3's
qualification is the normal case rather than the exception.

The reading technique, written down

§8.8 is 2190 lines. Its normative tables are 725 of them; the rest is worked
examples, which are illustrative and not what a translation needs. Dropping the
Examples subsections before reading is the difference between "too big for one
sitting" and "one sitting", and docs/dev/stdlib-worksheets/README.md now says
so with the one-liner that does it.

The examples still earn a second pass — §8.15.10's showed which actor the
traffic-light actions hang off, and §8.12.2's showed create_route being called
with fewer arguments than it declares — but they are not the first pass.

Tests

frontends/dsl/tests/dsl_stdlib_test.cpp, +8 cases: the intermediate bases and
their place in the hierarchy; every movable_object, vehicle and person
action with its parent and parameter count; the change/keep direction
asymmetry; the four enums; the deprecated parameter; the action-vs-modifier
name distinction; and the new enum ambiguity in both directions.

1278 gtest (+8), 184 pytest. TheBundledLibraryChecksClean still asserts
zero diagnostics of any severity.

Docs: osc-dsl-coverage.md, the new worksheet, and the worksheet README.

Refs #43

Translates §8.8.2–§8.8.4 into bundled DSL source: fifteen actions for
`movable_object`, thirteen for `vehicle`, `walk` for `person`, and the four
enums they use.

Also declares `action_for_vehicle` and `action_for_person`. §8.8.1 gives
`osc_action` exactly two children, then §8.8.3 and §8.8.4 name these two as
parents without any table declaring them; §8.8.1's prose supplies them —
actions for actors below `movable_object` inherit `action_for_movable_object`.
Fourteen actions would otherwise have no parent to name.

Judgement calls, all recorded in the worksheet:

- Mutually exclusive parameters are still plain fields. §8.8.2.4 says "use
  only one of the three"; `replay_path` marks both `absolute` and `relative`
  mandatory though only one can be given. The language has no choice group and
  §7.3.11 already lets a scenario leave a field unconstrained.
- `change_position.target_xyz` is marked deprecated in the same row that
  declares it. It is declared: there is no deprecation marker in the language,
  and dropping a field the standard prints would reject a conforming scenario.
- `change_lane.reference` documents `Default=it.actor`, which is not a constant
  expression, so no default is declared.
- The `change_*`/`keep_*` gap pairs take different direction enums —
  `gap_direction` has six values, `road_distance_direction` two. Carried as
  printed and pinned, because it reads like an oversight.

`change_speed`, `keep_speed` and `change_lane` are actions here and modifiers
in §8.9. They do not collide: an action's name is a qualified behavior name
(§7.2.2.2.5), so this chapter declares `movable_object.change_speed` while
§8.9 will declare a plain `change_speed`. Pinned in both directions so the
next slice cannot blur it.

The worksheet README now records the reading technique that made this chapter
tractable: §8.8 is 2190 lines, of which 725 are normative tables and the rest
worked examples. Dropping the Examples subsections first is the difference
between "too big for one sitting" and "one sitting".

1278 gtest (+8), 184 pytest. The library still checks with zero diagnostics of
any severity.

Refs #43
@JArmandoAnaya
JArmandoAnaya merged commit 337299a into main Aug 2, 2026
12 checks passed
@JArmandoAnaya
JArmandoAnaya deleted the feat/p7-s5-movement-actions branch August 2, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant