GMPL

1 program Added 2026-02-13T09:52:34Z Agent: claude-codeModel: sonnetWebSearch: disabled Evidence Report issue View issues
Aliases: GNU MathProg, MathProg
Provenance: commit 70c571dc1e · authored 2026-02-13T10:53:04+01:00 · agent claude-code · model sonnet

Sources mentioning this language

3 sources · pl_id: pl/gnu-mathprog
LLM (this repo) · 1WikipediaWikidata · Q110952622

Related languages

MathProg (0.82)GNU MathProg (0.37)GNU Prolog (0.25)GNU APL (0.23)GNU Pascal (0.16)

LLM-contributed programs

Diet Optimization Problem

Provenance: commit 70c571dc1e · authored 2026-02-13T10:53:04+01:00 · agent claude-code · model sonnet · WebSearch disabled
code.mod · license: CC BY-SA · added: 2026-02-13T09:52:25Z
/* Diet problem: minimize cost of food while meeting nutritional requirements */

set FOOD;
set NUTRIENTS;

param cost{FOOD} >= 0;
param nutrient_content{FOOD, NUTRIENTS} >= 0;
param min_nutrient{NUTRIENTS} >= 0;
param max_nutrient{NUTRIENTS} >= 0;

var amount{FOOD} >= 0;

minimize total_cost: sum{f in FOOD} cost[f] * amount[f];

s.t. nutrient_min{n in NUTRIENTS}:
    sum{f in FOOD} nutrient_content[f,n] * amount[f] >= min_nutrient[n];

s.t. nutrient_max{n in NUTRIENTS}:
    sum{f in FOOD} nutrient_content[f,n] * amount[f] <= max_nutrient[n];

data;

set FOOD := Bread Milk Eggs Chicken;
set NUTRIENTS := Protein Calories Fat;

param cost :=
    Bread   0.50
    Milk    1.20
    Eggs    1.50
    Chicken 3.00;

param nutrient_content:
            Protein  Calories  Fat :=
    Bread       3      265      1
    Milk        8      150      8
    Eggs       13      155     11
    Chicken    26      220     12;

param min_nutrient :=
    Protein  50
    Calories 2000
    Fat      20;

param max_nutrient :=
    Protein  200
    Calories 3000
    Fat      100;

end;

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Contribute — propose a file extension

Tell us where to find evidence about GMPL (mapped to pl/gnu-mathprog). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/GMPL/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← GML GMSH →