MiniZinc Named Arguments
Add named-argument calls and parameter defaults to the MiniZinc compiler, with the call-resolution rules that combine them with overloading, across parser, type checker and flattening.
Results
Each square represents one run. Score is the percentage of runs that pass: 0, 25, 50, 75, or 100 for four runs.
| # | Model | Rollouts | Pass@1 | Score | Time |
|---|---|---|---|---|---|
| 1 | GPT-6 Astra xhigh | 4/4 | 2.8h | ||
| 2 | Claude Sonnet 5.5 max | 4/4 | 3.5h | ||
| 3 | GPT-6.1 Sol max | 2/4 | 3.8h | ||
| 4 | Claude Opus 5.5 max | 1/4 | 3.2h | ||
| 5 | GPT-5.6 Sol max | 0/4 | 3.0h | ||
| 6 | Gemini 3.8 Flash high | 0/4 | 1.4h | ||
| 7 | Qwen3.8 Max xhigh | 0/4 | 3.1h | ||
| 8 | GLM 5.3 Flash max | 0/4 | 4.0h | ||
| 9 | Muse Spark 1.3 max | 0/4 | 2.1h | ||
| 10 | Kimi K3 max | 0/4 | 3.5h | ||
| 11 | Grok 4.7 xhigh | 0/4 | 1.5h |
Background
MiniZinc is a constraint modeling language used in operations research and scheduling. Its compiler, libminizinc, type-checks models and flattens them into FlatZinc for solvers. Calls are positional only, so library constraints with five or six array arguments are hard to read and every optional argument needs its own overload. Starting from commit f4943c1, the agent adds named arguments and parameter defaults per the reference manual. Once a call can pick an overloading by the names it uses, some existing declarations become ambiguous, and call resolution must select the same overloading in every context: root and reified constraints, par evaluation, output, comprehensions, polymorphic operations and calls inside other function bodies.
Task
The agent implements name: expr call arguments and ti: name = expr parameter defaults across the parser, type checker, flattening and standard library. Positional arguments come first, each parameter is bound once, defaults form a suffix, underscore-prefixed parameters cannot be passed by name, and bodyless operations stay positional-only. Two overloadings that a fully named call cannot distinguish are an error, and a call resolves to the matching overloading lowest on the type-inst lattice. Standard library parameter names stay as they are, existing models keep their meaning, and a rejected model must fail with a normal MiniZinc error, not a crash.
Workspace
The offline sandbox (4 CPUs, 8 GB, 4 hours) holds a libminizinc checkout at commit f4943c1, a configured Release build with the Gecode, Chuffed, HiGHS and CBC solvers, and the project's pytest suite, plus eight example models with expected results. The graded models are held out.
Verification
The committed tree is rebuilt from a clean checkout in a separate environment, and 1,963 existing tests must pass. 594 hidden models exercise binding, defaults, ambiguity, name-only overloads, library globals and error cases, alone and combined with existing language features. Each model must produce the same solution output as the maintainers' implementation or be rejected with an error, within 30 seconds. Error wording, warnings and FlatZinc text are never compared. The models form 24 groups, and a pass requires every group to reach 85%.
Environment
- Toolchain
- C++
- Compute
- 4 CPUs · 8 GB RAM
- Network
- Offline
- Time limit
- 4 hours
References
- libminizinc: The MiniZinc compiler the agent extends; the maintainers' implementation of the feature is the grading reference.
- The MiniZinc Handbook: specification: The reference manual whose call, overloading and type-inst rules the feature extends.