Problem Statement
The current Arco KDL syntax has terminology inconsistencies and ambiguities that confuse users:
map keyword — reads as "mapping to a set" but actually renames a CSV column
alias overloaded — used for both data column aliases and set shorthand
control keyword — optimization users expect var or variable
filter keyword — where is more familiar (SQL, Python)
- Bound syntax — no clear pattern for indexed bounds (e.g.,
upper=capacity[g])
Solution
Rename keywords for clarity while maintaining backwards compatibility where feasible:
| Before |
After |
Purpose |
map X from="col" |
alias X column="col" |
Data column rename |
set X alias=g |
set X as=g |
Set shorthand |
control x lower=0 |
var x lower=0 |
Decision variable |
filter { cond } |
where { cond } |
Set subsetting |
Additional syntax clarifications:
- Indexed bounds:
upper { capacity[g] } / lower { expr } inside var block
- Path resolution: relative to KDL file, overridable via
--data-dir or ARCO_DATA_DIR
Implementation Decisions
Parser Changes
- Add
alias as new keyword; deprecate map (warn on use, still parse)
- Add
as= property on set; deprecate alias= property
- Add
var as new keyword; deprecate control (warn on use, still parse)
- Add
where as new keyword; deprecate filter
- Parse
lower { expr } / upper { expr } as child nodes in var blocks
Path Resolution
- Resolve
from="..." paths relative to the input KDL file location
--data-dir CLI flag overrides (highest priority)
ARCO_DATA_DIR env var as fallback
- Document resolution order in help/docs
Backwards Compatibility
control, map, set alias=, filter continue to parse with deprecation warnings
- Deprecation warnings include migration hint (e.g., "use
var instead of control")
Testing Decisions
- Unit tests: Parser accepts both old and new syntax; emits correct AST
- Deprecation tests: Old keywords trigger warnings with correct messages
- Path resolution tests: Verify relative,
--data-dir, and ARCO_DATA_DIR precedence
- Integration test: Update
examples/nodal-allocation/input.kdl to new syntax; verify model runs
Out of Scope
- Multi-objective optimization syntax
- Model linking/composition semantics
- Hierarchical optimization (see ADR-0001)
References
CONTEXT.md — domain language
docs/adr/0001-objective-composition-deferred.md — deferred decisions
examples/nodal-allocation/input.kdl — example to migrate
Problem Statement
The current Arco KDL syntax has terminology inconsistencies and ambiguities that confuse users:
mapkeyword — reads as "mapping to a set" but actually renames a CSV columnaliasoverloaded — used for both data column aliases and set shorthandcontrolkeyword — optimization users expectvarorvariablefilterkeyword —whereis more familiar (SQL, Python)upper=capacity[g])Solution
Rename keywords for clarity while maintaining backwards compatibility where feasible:
map X from="col"alias X column="col"set X alias=gset X as=gcontrol x lower=0var x lower=0filter { cond }where { cond }Additional syntax clarifications:
upper { capacity[g] }/lower { expr }inside var block--data-dirorARCO_DATA_DIRImplementation Decisions
Parser Changes
aliasas new keyword; deprecatemap(warn on use, still parse)as=property onset; deprecatealias=propertyvaras new keyword; deprecatecontrol(warn on use, still parse)whereas new keyword; deprecatefilterlower { expr }/upper { expr }as child nodes in var blocksPath Resolution
from="..."paths relative to the input KDL file location--data-dirCLI flag overrides (highest priority)ARCO_DATA_DIRenv var as fallbackBackwards Compatibility
control,map,set alias=,filtercontinue to parse with deprecation warningsvarinstead ofcontrol")Testing Decisions
--data-dir, andARCO_DATA_DIRprecedenceexamples/nodal-allocation/input.kdlto new syntax; verify model runsOut of Scope
References
CONTEXT.md— domain languagedocs/adr/0001-objective-composition-deferred.md— deferred decisionsexamples/nodal-allocation/input.kdl— example to migrate