{
  "schemaVersion": 1,
  "slug": "popcorn-calculator",
  "category": "cooking",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "4932459f3e180c6af57996840e883c3c448988134a737f3d6bf5c629a62e4acd",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/popcorn-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "g = S × c × 6.25; oil = S × c ÷ 12; kcal = S × c × 31",
    "vars": [
      [
        "g",
        "Kernels (g)"
      ],
      [
        "S",
        "Servings"
      ],
      [
        "c",
        "Popped cups per serving"
      ],
      [
        "oil",
        "Oil (tbsp)"
      ],
      [
        "kcal",
        "Calories"
      ]
    ],
    "note": "Scales fixed kernel, oil and calorie heuristics from servings × cups per serving. Calories use 31 kcal per cup of popped popcorn and exclude oil, butter and toppings; ingredient ratios vary by kernel, pop method and serving size."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const cups = servings*cupsPerServing; const oil = cups/12; const grams = cups*6.25; return { kernelGrams: grams, kernelTablespoons: grams/8, poppedCups: cups, oilTablespoons: oil, calories: cups*31 };",
    "inputs": [
      {
        "name": "servings",
        "type": "number",
        "default": 4,
        "min": 0,
        "max": 1000,
        "step": 1,
        "slider": true
      },
      {
        "name": "cupsPerServing",
        "type": "number",
        "default": 3,
        "min": 0.5,
        "max": 20,
        "step": 0.5,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "kernelGrams",
        "precision": 0,
        "unit": "g"
      },
      {
        "name": "kernelTablespoons",
        "precision": 1,
        "unit": "tbsp"
      },
      {
        "name": "poppedCups",
        "precision": 1,
        "unit": "cups"
      },
      {
        "name": "oilTablespoons",
        "precision": 1,
        "unit": "tbsp"
      },
      {
        "name": "calories",
        "precision": 0,
        "unit": "kcal"
      }
    ],
    "interpret": null
  }
}
