General Context Labs
06Software Engineering11 of 44 runs pass

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.

#ModelRolloutsPass@1ScoreTime
1GPT-6 Astra xhigh4/41002.8h
2Claude Sonnet 5.5 max4/41003.5h
3GPT-6.1 Sol max2/450.03.8h
4Claude Opus 5.5 max1/425.03.2h
5GPT-5.6 Sol max0/403.0h
6Gemini 3.8 Flash high0/401.4h
7Qwen3.8 Max xhigh0/403.1h
8GLM 5.3 Flash max0/404.0h
9Muse Spark 1.3 max0/402.1h
10Kimi K3 max0/403.5h
11Grok 4.7 xhigh0/401.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.
All tasks