@@ -17,6 +17,7 @@ This document defines the low-level Arco DSL profile authored in KDL 2.0.
1717Scope of this specification:
1818
1919- [ ` set ` ] ( #4-set-declaration-top-level ) declarations (explicit domains)
20+ - [ ` projection ` ] ( #45-projection-declaration-top-level ) declarations (named tuple-domain projections)
2021- [ ` data ` ] ( #5-data-declaration ) declarations (CSV-backed namespaces)
2122- [ ` param ` ] ( #31-inline-scalar-parameters ) declarations (inline scalar constants)
2223- [ ` param ` ] ( #54-param-inside-data ) declarations (CSV-backed projection,
@@ -40,6 +41,7 @@ Scope of this specification:
4041- [ 3. Top-level declarations] ( #3-top-level-declarations )
4142 - [ 3.1 Inline scalar parameters] ( #31-inline-scalar-parameters )
4243- [ 4. ` set ` declaration (top-level)] ( #4-set-declaration-top-level )
44+ - [ 4.5 ` projection ` declaration (top-level)] ( #45-projection-declaration-top-level )
4345- [ 5. ` data ` declaration] ( #5-data-declaration )
4446 - [ 5.1 ` map ` ] ( #51-map )
4547 - [ 5.2 ` set ` (inside ` data ` )] ( #52-set-inside-data )
@@ -98,7 +100,7 @@ supported. Slashdash (`/-`) comments out an entire node, property, or argument,
98100which is useful for toggling declarations during development.
99101
100102Unknown nodes: Implementations MUST reject unknown top-level node types
101- (anything other than ` set ` , ` data ` , ` param ` , ` model ` , ` scenario ` ). Inside
103+ (anything other than ` set ` , ` projection ` , ` data ` , ` param ` , ` model ` , ` scenario ` ). Inside
102104blocks, unknown child node types MUST also fail validation. This ensures forward
103105compatibility is explicit: new node types require a spec version bump.
104106
@@ -343,9 +345,8 @@ indexed or scalar via a single-row CSV). Inline scalars MUST NOT have `index`,
343345
344346## 4. ` set ` declaration (top-level)
345347
346- A top-level ` set ` declares a named domain with explicit members listed inline.
347- This is useful for sets that are not backed by a CSV file, for example index
348- ranges, scenario labels, or piecewise segments.
348+ A top-level ` set ` declares a named domain. It supports either explicit inline
349+ members or subset/tuple-set forms built from existing sets.
349350
350351Explicit member list:
351352
@@ -369,6 +370,22 @@ Alias:
369370set time alias=t { 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24 }
370371```
371372
373+ Subset/tuple-set form:
374+
375+ ``` kdl
376+ set "priority_links" {
377+ in "feasible_links"
378+ index "a" { in "area" }
379+ index "i" { in "tech" }
380+ index "g" { in "generators" }
381+ index "b" { in "buses" }
382+ filter { area == "south" }
383+ }
384+ ```
385+
386+ In this form, ` in ` identifies the parent tuple set, ` index ` declares the tuple
387+ signature, and ` filter ` (optional) narrows rows.
388+
372389Top-level sets are globally visible, just like sets declared inside ` data `
373390blocks. They can be used in any model, constraint, or algebra expression.
374391
@@ -377,6 +394,26 @@ MUST NOT have the same name as a set declared inside a `data` block.
377394
378395---
379396
397+ ## 4.5 ` projection ` declaration (top-level)
398+
399+ ` projection ` declares a named lower-dimensional tuple domain derived from a
400+ parent tuple set.
401+
402+ ``` kdl
403+ projection "ai" {
404+ from "feasible_links"
405+ to "a" "i"
406+ }
407+ ```
408+
409+ Semantics:
410+
411+ - ` from ` MUST reference an existing tuple-domain set.
412+ - ` to ` MUST list one or more tuple component names present on the parent tuple
413+ signature, in parent declaration order.
414+ - Projected rows are deduplicated by value.
415+ - Projection names MUST be unique in the top-level namespace.
416+
380417## 5. ` data ` declaration
381418
382419` data ` declares one CSV-backed namespace. Sets and parameters declared inside
@@ -417,6 +454,7 @@ Allowed children:
417454```
418455map <logical_name>
419456map <logical_name> from=<source_header>
457+ alias <logical_name> column=<source_header>
420458```
421459
422460Semantics:
@@ -425,6 +463,8 @@ Semantics:
425463 MUST exist in the CSV.
426464- Mapping is optional. Unmapped columns remain available.
427465- Duplicate logical targets MUST fail validation.
466+ - ` alias <logical_name> column=<source_header> ` is accepted as an equivalent
467+ spelling of ` map <logical_name> from=<source_header> ` .
428468
429469### 5.2 ` set ` (inside ` data ` )
430470
@@ -438,6 +478,7 @@ constraint, or algebra expression in the document.
438478```
439479set <name>
440480set <name> alias=<short>
481+ set <name> as=<short>
441482set <name> {
442483 in <parent_set>
443484}
@@ -450,8 +491,8 @@ set <name> {
450491Semantics:
451492
452493- ` set class ` extracts unique values from the ` class ` column.
453- - ` alias ` provides a short set reference that MAY be used wherever a set
454- reference is expected (` index= ` property, ` index ` children,
494+ - ` alias ` (or equivalent ` as ` ) provides a short set reference that MAY be used
495+ wherever a set reference is expected (` index= ` property, ` index ` children,
455496 ` index ... { in ... } ` , and algebra iteration domains). Example:
456497 ` set asset_id alias=a ` allows ` param capacity { index a } ` ,
457498 ` index a_idx { in a } ` , and ` dispatch[a,t] ` .
@@ -1124,6 +1165,27 @@ the point of use. When an expression is referenced inside a constraint with
11241165` index ` clauses, the constraint's iteration variables are in scope for the
11251166expression body.
11261167
1168+ Projection-reduce expression form:
1169+
1170+ ``` kdl
1171+ expression "investment_by_area_tech" {
1172+ reduce "ai" {
1173+ sum "investment"
1174+ }
1175+ }
1176+ ```
1177+
1178+ This form aggregates a higher-dimensional control/expression onto a named
1179+ projection domain.
1180+
1181+ Rules:
1182+
1183+ - the projection name (` "ai" ` above) MUST resolve to a declared ` projection ` .
1184+ - the body MUST contain exactly one reduction operation.
1185+ - currently supported operation is ` sum ` .
1186+ - the reduction target (` "investment" ` above) MUST have a tuple signature
1187+ compatible with the projection source and target dimensions.
1188+
11271189### 6.5 ` constraint `
11281190
11291191Two supported forms.
0 commit comments