"All ultra-processed foods are inherently unhealthy and should be avoided completely."

nutrition health · generated 2026-03-28 · v1.0.0
DISPROVED 6 citations
Evidence assessed across 6 verified citations.
Verified by Proof Engine — an open-source tool that verifies claims using cited sources and executable code. Reasoning transparent and auditable.
methodology · github · re-run this proof · submit your own

The claim that every ultra-processed food is inherently harmful and that everyone should avoid them entirely is not supported by the major health institutions that study this question — in fact, they say the opposite.

What Was Claimed?

The claim is that ultra-processed foods — a broad category defined by industrial production methods and added ingredients — are bad for you by their very nature, and that no one should ever eat them. You've probably seen versions of this online: lists of "foods to never eat," warnings that anything with more than five ingredients is toxic, or blanket advice to cut out all processed foods entirely. The claim matters because ultra-processed foods make up a large portion of modern diets worldwide, and sweeping avoidance advice, if wrong, could create unnecessary anxiety or lead people to reject foods that are actually fine.

What Did We Find?

The claim is actually two claims packaged together: first, that every ultra-processed food is inherently harmful; and second, that health authorities recommend avoiding them completely. Both parts are false.

On the first part, the UK's National Health Service explicitly lists ultra-processed foods — wholemeal sliced bread, wholegrain breakfast cereals, baked beans — that it considers acceptable in a healthy diet. These foods are classified as "ultra-processed" under the standard food classification system due to their industrial production, yet the NHS recommends them without hesitation. Harvard's nutrition experts similarly note that some of these products "may be a useful addition to a healthful diet." A peer-reviewed nutrition journal article puts it plainly: "there are good and bad diets, not good and bad foods."

On the second part, not one major health authority — not the WHO, not the NHS, not Harvard — tells people to avoid all ultra-processed foods completely. The WHO says to "limit" foods high in unhealthy fats, free sugars, and sodium. The NHS says most people "would probably benefit from eating less" of certain ultra-processed foods. Harvard frames it as a consumer choice with trade-offs. "Eat less of some" is a very different message from "avoid all."

There is also a structural problem with the claim. The category of "ultra-processed" foods is remarkably wide. Under the standard classification system, it includes diet sodas and commercially produced infant formula in the same group. The American Academy of Pediatrics recommends infant formula for babies who cannot breastfeed — a direct contradiction of any blanket avoidance rule. Even the researchers who created the ultra-processed food classification have acknowledged that no studies have examined what a strict avoidance policy would mean for infants.

The strongest research on this topic — a large Spanish study published in the BMJ — found that people eating four or more servings of ultra-processed food per day had higher mortality than those eating fewer. But the lowest-consumption group, who still ate some ultra-processed foods, had the best outcomes. The harm appears at high intake, not at any consumption whatsoever, and the study's authors were careful to note they couldn't rule out other contributing factors.

What Should You Keep In Mind?

The disproof of this specific claim does not mean ultra-processed foods are harmless or that dietary patterns don't matter. The evidence consistently supports reducing intake of ultra-processed foods that are high in saturated fat, added sugar, and sodium — chips, sugary drinks, fast food. That advice is well-grounded. What is not grounded is the leap from "eat less of the bad ones" to "all of them are inherently harmful and none should ever be consumed."

The "ultra-processed" label covers an enormous range of products, which makes blanket health claims about the category unreliable. Wholemeal bread and diet soda are not nutritionally equivalent just because both get the same label. The classification system was designed for population-level research and policy, not as a per-product health verdict.

It is also worth noting that the observational research in this area, while suggestive, cannot establish that ultra-processing itself causes harm independent of the nutrients involved. People who eat more ultra-processed foods tend to have different overall diets and lifestyles — separating the effect of processing from the effect of eating more sugar and saturated fat is genuinely difficult.

How Was This Verified?

This claim was broken into its two component parts and each was tested against independent authoritative sources, with adversarial checks to look for evidence that could overturn the finding. All six sources were verified by live fetch with direct quote confirmation. You can read the full reasoning in the structured proof report, examine every source and verification step in the full verification audit, or re-run the proof yourself.

What could challenge this verdict?

Four adversarial questions were investigated:

1. Do any major health authorities support complete avoidance of all UPFs? Searched WHO, NHS, USDA dietary guidelines, and Brazil's 2014 Dietary Guidelines (which originated the NOVA anti-UPF movement). Brazil's guidelines do say "Avoid ultra-processed foods," but this is contested by other nutrition bodies and is framed as a cultural preference, not a universal health directive. Crucially, the American Academy of Pediatrics (AAP) continues to recommend infant formula — a NOVA Group 4 food — for infants who cannot breastfeed, directly contradicting any universal avoidance policy.

2. Do observational studies show harm from any level of UPF consumption? The most-cited study (Rico-Campà et al., BMJ 2019, SUN cohort) found higher all-cause mortality in the highest quartile (≥4 servings/day) vs. the lowest. This is dose-dependent — the lowest-quartile group, who still consumed some UPFs, had the best outcomes. The authors explicitly acknowledge inability to rule out residual confounding. A 2020 systematic review (Elizabeth et al., Nutrients) of 43 studies found all associations at population/dietary-pattern level, not individual-product level.

3. Is the NOVA category coherent enough to support a universal claim? Gibney (2019) documents that NOVA classifies infant formula as ultra-processed and "to be avoided" while acknowledging no study has examined the implications of this policy for infants. The category's breadth — spanning diet sodas, fortified cereals, wholemeal bread, and infant formula — is itself an argument against any universal health claim about it.

4. Do NOVA originators claim all UPFs are "inherently" harmful? Monteiro et al.'s peer-reviewed papers phrase findings as population-level associations and argue that processing itself may cause harm beyond nutrient composition. However, even they do not claim in the literature that any dose of any UPF is inherently harmful. The "inherently unhealthy" framing exceeds what the strongest pro-NOVA researchers assert in their published work.

No adversarial check broke the disproof.

Source: proof.py JSON summary (adversarial_checks)


Sources

SourceIDTypeVerified
NHS (UK National Health Service) — What are processed foods? B1 Unclassified Yes
Harvard T.H. Chan School of Public Health — The Nutrition Source: Processed Foods B2 Academic Yes
Gibney MJ (2019), Ultra-Processed Foods: Definitions and Policy Issues, Current Developments in Nutrition, PMC6389637 B3 Government Yes
NHS (UK National Health Service) — What are processed foods? B4 Unclassified Yes
World Health Organization — Healthy Diet Fact Sheet B5 Government Yes
Harvard T.H. Chan School of Public Health — The Nutrition Source: Processed Foods B6 Academic Yes
SC1 verified disproof source count A1 Computed
SC2 verified disproof source count A2 Computed

detailed evidence

Detailed Evidence

Evidence Summary

ID Fact Verified
B1 SC1: NHS — explicitly names UPFs acceptable in a healthy diet Yes
B2 SC1: Harvard T.H. Chan Nutrition Source — some UPFs may be useful Yes
B3 SC1: Gibney 2019 (Curr Dev Nutr) — no good/bad foods, only diets Yes
B4 SC2: NHS — recommends 'eating less' not complete avoidance Yes
B5 SC2: WHO Healthy Diet fact sheet — 'limit' not 'avoid completely' Yes
B6 SC2: Harvard — UPF use is consumer choice, pros and cons Yes
A1 SC1 verified disproof source count Computed: 3 of 3 sources confirmed (meets threshold of ≥3)
A2 SC2 verified disproof source count Computed: 3 of 3 sources confirmed (meets threshold of ≥3)

Source: proof.py JSON summary


Proof Logic

Sub-claim 1: "All ultra-processed foods are inherently unhealthy"

The NHS (B1) directly contradicts the universal framing: "Some ultra-processed foods can be included in a healthy diet – such as wholemeal sliced bread, wholegrain or higher fibre breakfast cereals or baked beans." This is not a hedge or a caveat — the UK's national health service explicitly enumerates ultra-processed foods it considers acceptable. Under the NOVA classification, wholemeal sliced bread and wholegrain breakfast cereals are classified as ultra-processed (Group 4) due to their industrial production processes and added ingredients. Yet the NHS recommends them. This constitutes a direct counterexample to the universal claim.

Harvard T.H. Chan School of Public Health (B2) similarly states that "some products may be a useful addition to a healthful diet," and notes that NOVA "has been criticized for being too general in classifying certain foods, causing confusion."

Gibney (2019), writing in Current Developments in Nutrition (B3), states: "there are good and bad diets, not good and bad foods." This directly articulates the scientific consensus position that the "inherently unhealthy" per-food framing is itself a departure from established nutrition science principles.

A further structural problem: the NOVA Group 4 classification includes commercially produced infant formula, which NOVA's own documentation states is "to be avoided." Yet no mainstream health authority — WHO, AAP, NHS, CDC — endorses withholding formula from infants who cannot breastfeed. This reveals the heterogeneity of the NOVA Group 4 category: it lumps together diet sodas and life-sustaining infant nutrition under one label, making any universal health claim about the category untenable.

SC1 result: 3/3 independent authoritative sources confirmed (≥3 threshold met). SC1 is DISPROVED.

Sub-claim 2: "Should be avoided completely"

The NHS (B4) uses reduction language: "Most people would probably benefit from eating less ultra-processed foods that are high in saturated fat, salt or sugar." "Eating less" is not "avoid completely." The qualifier "that are high in saturated fat, salt or sugar" further narrows the concern to specific nutrient-dense UPFs, not the entire category.

The World Health Organization (B5) states that "Foods high in unhealthy fats, free sugars and sodium should be limited." WHO's consistently uses "limit" and "reduce" throughout its healthy diet guidance — not "avoid completely." Its policy recommendations call for taxes and production incentives aimed at reducing high-fat/sugar/sodium processed foods, not a blanket elimination directive.

Harvard T.H. Chan (B6) frames consumption as a consumer choice with trade-offs: "the use of processed and even ultra-processed foods is the choice of the consumer, and there are pros and cons that come with each type." This framing is incompatible with a directive to "avoid completely."

SC2 result: 3/3 independent authoritative sources confirmed (≥3 threshold met). SC2 is DISPROVED.

Compound verdict

Because the original claim is (SC1 AND SC2) and both sub-claims are individually disproved by independent verified sources, the compound claim is DISPROVED.

Source: author analysis


Conclusion

Verdict: DISPROVED

The compound claim fails on both conjuncts:

  • SC1 ("all UPFs are inherently unhealthy") is disproved by 3 verified independent authoritative sources — NHS (B1), Harvard T.H. Chan (B2), and Gibney 2019 in Current Developments in Nutrition (B3) — all of which explicitly reject the universal or per-food framing. The NHS enumerates specific UPFs that belong in a healthy diet; the peer-reviewed literature holds that "there are good and bad diets, not good and bad foods."

  • SC2 ("should be avoided completely") is disproved by 3 verified independent authoritative sources — NHS (B4), WHO (B5), and Harvard (B6) — all of whom use reduction/limitation language, not elimination language. No major health authority recommends complete avoidance of all ultra-processed foods.

All 6 citations were fully verified by live fetch. The disproof does not depend on any unverified citation.

What the evidence does support: High consumption of ultra-processed foods (particularly those high in saturated fat, salt, and free sugars) is associated with adverse health outcomes in observational studies. Reducing UPF intake — especially for nutrient-poor, high-calorie varieties — is consistently recommended by authoritative health bodies. The evidence supports moderation and substitution, not categorical avoidance.

Note on source credibility: Citations B1 and B4 (both from nhs.uk) are classified as tier 2 (unclassified domain) by the automated domain-based credibility scorer. The NHS is the UK's national health service and is authoritative; the tier-2 score reflects a limitation of domain-based classification (.uk TLD not recognized as government tier). The disproof does not depend solely on these sources: SC1 is also confirmed by B2 (Harvard, tier 4) and B3 (NIH/PubMed Central, tier 5); SC2 is also confirmed by B5 (WHO, tier 5) and B6 (Harvard, tier 4).

Source: proof.py JSON summary; impact analysis is author analysis

audit trail

Citation Verification 6/6 verified

All 6 citations verified.

Original audit log

B1 — sc1_nhs - Status: verified - Method: full_quote - Fetch mode: live - Coverage: N/A (full quote match)

B2 — sc1_harvard - Status: verified - Method: full_quote - Fetch mode: live - Coverage: N/A (full quote match)

B3 — sc1_gibney - Status: verified - Method: full_quote - Fetch mode: live - Coverage: N/A (full quote match)

B4 — sc2_nhs - Status: verified - Method: full_quote - Fetch mode: live - Coverage: N/A (full quote match)

B5 — sc2_who - Status: verified - Method: full_quote - Fetch mode: live - Coverage: N/A (full quote match)

B6 — sc2_harvard - Status: verified - Method: full_quote - Fetch mode: live - Coverage: N/A (full quote match)

All 6 citations verified via live fetch. No unverified citations. No impact analysis required.

Source: proof.py JSON summary


Claim Specification
Field Value
Subject Ultra-processed foods (NOVA Group 4 classification)
Proof direction disprove
Compound operator AND
SC1 property Every food classified as ultra-processed (NOVA Group 4) is inherently harmful regardless of context, quantity, or individual nutrient composition
SC1 operator >=
SC1 threshold 3
SC1 proof direction disprove
SC1 operator note 'All UPFs are inherently unhealthy' is a universal claim. Logically, one credible counterexample disproves a universal. Threshold set to 3 (≥3 independent authoritative sources that reject the universal framing or identify UPFs acceptable in a healthy diet) to require multi-source consensus, not isolated dissent.
SC2 property Authoritative health bodies recommend complete avoidance of all ultra-processed foods (i.e., no UPF should ever be consumed by anyone)
SC2 operator >=
SC2 threshold 3
SC2 proof direction disprove
SC2 operator note 'Should be avoided completely' is read as an absolute, context-free recommendation. To disprove it, ≥3 independent authoritative health bodies or peer-reviewed sources must use reduction/limitation language — not elimination — and/or explicitly allow some UPFs in a healthy diet.
Compound operator note The original claim is compound: (SC1 AND SC2). To disprove the AND claim, disproving either sub-claim is logically sufficient. This proof disproves both.

Source: proof.py JSON summary


Claim Interpretation

Natural language claim: "All ultra-processed foods are inherently unhealthy and should be avoided completely."

This is a compound claim with two conjuncts joined by AND:

SC1 — Universal health claim: "All ultra-processed foods are inherently unhealthy." This asserts that every food in NOVA Group 4 (the ultra-processed classification) is harmful by its very nature, regardless of its specific nutrient composition, quantity consumed, or context of consumption (e.g., infant formula for a newborn who cannot breastfeed).

A universal claim of the form "all X are Y" is logically disproved by a single credible counterexample. The threshold is set to 3 independent authoritative sources to require genuine multi-source consensus rather than relying on any single dissenting voice.

SC2 — Absolute recommendation claim: "Should be avoided completely." This asserts that no ultra-processed food should ever be consumed by anyone. To disprove it, we look for authoritative health bodies whose actual published guidance recommends reduction or limitation rather than elimination, or that explicitly allow some UPFs in a healthy diet.

Compound logic: Because the original claim is (SC1 AND SC2), it is false if either sub-claim is false. Both sub-claims are disproved here.

Source: proof.py JSON summary


Source Credibility Assessment
Fact ID Domain Type Tier Note
B1 nhs.uk unclassified 2 Unclassified domain — verify source authority manually. The NHS is the UK's national health service and is authoritative; the tier-2 score reflects a limitation of domain-based automated scoring (.uk TLD not in the government tier).
B2 harvard.edu academic 4 Academic domain (.edu)
B3 nih.gov government 5 Government domain (.gov) — PubMed Central, National Institutes of Health
B4 nhs.uk unclassified 2 Same as B1 — NHS is authoritative; tier-2 is a scoring artifact.
B5 who.int government 5 Known government/intergovernmental organization (WHO)
B6 harvard.edu academic 4 Academic domain (.edu)

The two tier-2 citations (B1, B4) are both from nhs.uk, the official website of the UK National Health Service. Their authority is well established; the low tier score is an artifact of the automated domain classifier not recognizing .uk TLDs as government. The disproof does not depend solely on these sources: SC1 is also supported by B2 (Harvard, tier 4) and B3 (NIH, tier 5); SC2 is also supported by B5 (WHO, tier 5) and B6 (Harvard, tier 4).

Source: proof.py JSON summary


Computation Traces
  [✓] sc1_nhs: Full quote verified for sc1_nhs (source: tier 2/unknown)
  [✓] sc1_harvard: Full quote verified for sc1_harvard (source: tier 4/academic)
  [✓] sc1_gibney: Full quote verified for sc1_gibney (source: tier 5/government)
  [✓] sc2_nhs: Full quote verified for sc2_nhs (source: tier 2/unknown)
  [✓] sc2_who: Full quote verified for sc2_who (source: tier 5/government)
  [✓] sc2_harvard: Full quote verified for sc2_harvard (source: tier 4/academic)
  SC1 confirmed sources: 3 / 3
  SC2 confirmed sources: 3 / 3
  SC1 disproof: verified sources rejecting 'all UPFs inherently unhealthy': 3 >= 3 = True
  SC2 disproof: verified sources rejecting 'should be avoided completely': 3 >= 3 = True

Source: proof.py inline output (execution trace)


Independent Source Agreement

SC1 Disproof Sources

Metric Value
Sources consulted 3
Sources verified 3
sc1_nhs verified
sc1_harvard verified
sc1_gibney verified
Independence note NHS (UK government health body), Harvard T.H. Chan (US academic institution), Gibney 2019 in peer-reviewed journal (Current Developments in Nutrition) — independent institutions across different countries and sectors.

SC2 Disproof Sources

Metric Value
Sources consulted 3
Sources verified 3
sc2_nhs verified
sc2_who verified
sc2_harvard verified
Independence note NHS (UK), WHO (international UN agency), Harvard T.H. Chan (US academic) — three independent institutions across jurisdictions and sectors.

Source: proof.py JSON summary


Adversarial Checks

Check 1: Do any major health authorities support complete avoidance of all UPFs? - Verification performed: Searched for 'WHO ultra-processed foods avoid completely,' 'NHS avoid all ultra-processed foods,' 'USDA dietary guidelines ultra-processed avoid completely,' and reviewed Brazil 2014 Dietary Guidelines (origin of NOVA classification). Also checked AAP (American Academy of Pediatrics) infant formula guidance. - Finding: No major health authority (WHO, NHS, CDC, USDA, AAP, BNF) recommends complete avoidance of all UPFs. Brazil's 2014 Dietary Guidelines say 'Avoid ultra-processed foods' but this is primarily a cultural/culinary preference statement and is explicitly contested by other nutrition bodies. The AAP continues to recommend infant formula (NOVA Group 4) for infants who cannot breastfeed, directly contradicting any universal avoidance directive. - Breaks proof: No

Check 2: Do observational studies show ALL UPF consumption is harmful, even at low levels? - Verification performed: Reviewed Rico-Campà et al. (BMJ 2019, PMC6538973) — largest-cited UPF mortality cohort study. Searched for 'ultra-processed food dose-response mortality low consumption' and 'ultra-processed food health benefit study.' Also reviewed Elizabeth et al. (Nutrients 2020, PMC7399967) systematic review. - Finding: Rico-Campà et al. (BMJ 2019) found higher all-cause mortality in the highest quartile (≥4 servings/day) vs lowest quartile — a dose-dependent, not absolute, association. The lowest-quartile group had best outcomes while still consuming some UPFs. Authors explicitly note inability to rule out residual confounding. Elizabeth et al. (Nutrients 2020) reviewed 43 studies; all associations were at population/dietary-pattern level, not individual-product level. No peer-reviewed study demonstrates that any dose of any UPF is inherently harmful. - Breaks proof: No

Check 3: Is the NOVA 'ultra-processed' category scientifically coherent enough to support a universal health claim? - Verification performed: Searched 'NOVA classification criticism reliability,' 'ultra-processed food definition controversy,' and reviewed Gibney 2019 (PMC6389637). Checked whether infant formula is classified as UPF under NOVA. - Finding: Gibney 2019 (PMC6389637) documents that NOVA classifies all commercially produced infant formula as ultra-processed and 'to be avoided,' yet 'no study has been undertaken to explore the implications of such a policy for this vulnerable group.' Harvard Nutrition Source states 'NOVA has been criticized for being too general in classifying certain foods, causing confusion.' The NOVA Group 4 category spans diet sodas, iron-fortified infant cereals, wholemeal sliced bread, and infant formula — a heterogeneous group that undermines any universal health claim. - Breaks proof: No

Check 4: Do NOVA originators themselves claim all UPFs are 'inherently' harmful? - Verification performed: Reviewed Monteiro et al. 2018 NOVA food classification paper and PAHO/WHO-aligned guidance. Searched 'Monteiro ultra-processed inherently unhealthy.' - Finding: NOVA proponents (Monteiro et al.) argue that processing itself may cause harm beyond nutrient composition and advocate strong policy restrictions. However, their peer-reviewed papers phrase findings as population-level associations, not absolute per-food determinations. The 'inherently unhealthy' framing — implying harm regardless of quantity or context — exceeds what even the strongest pro-NOVA researchers assert in the literature. - Breaks proof: No

Source: proof.py JSON summary


Quality Checks
Rule Status Details
Rule 1: No hand-typed extracted values ✓ PASS Qualitative proof — no numeric extraction. No date() literals or hand-typed values.
Rule 2: Citations verified by fetching ✓ PASS All 6 citations verified via live fetch using verify_all_citations().
Rule 3: System time anchored ✓ PASS date.today() present in proof.py.
Rule 4: Explicit claim interpretation ✓ PASS CLAIM_FORMAL dict with operator_note for both sub-claims and the compound claim.
Rule 5: Adversarial checks ✓ PASS 4 independent adversarial checks documented, all returning breaks_proof: False.
Rule 6: Independent cross-checks ✓ PASS 6 distinct source references across two independent institution sets per sub-claim.
Rule 7: No hard-coded constants/formulas ✓ PASS compare() used for all claim evaluations; no inline formulas or eval().
validate_proof.py ✓ PASS 13/13 checks passed, 0 issues, 0 warnings.

Source: proof.py inline output (execution trace); validate_proof.py output

Source Data

For qualitative proofs, the extraction records report citation verification status per source rather than numeric extraction.

Fact ID Value (Status) Countable? Quote Snippet
B1 verified Yes "Some ultra-processed foods can be included in a healthy diet – such as wholemeal"
B2 verified Yes "some products may be a useful addition to a healthful diet"
B3 verified Yes "there are good and bad diets, not good and bad foods"
B4 verified Yes "Most people would probably benefit from eating less ultra-processed foods that a"
B5 verified Yes "Foods high in unhealthy fats, free sugars and sodium should be limited."
B6 verified Yes "the use of processed and even ultra-processed foods is the choice of the consume"

Countable = citation status is "verified" or "partial" (counts toward the confirmation threshold).

Source: proof.py JSON summary (extractions)


Cite this proof
Proof Engine. (2026). Claim Verification: “All ultra-processed foods are inherently unhealthy and should be avoided completely.” — Disproved. https://doi.org/10.5281/zenodo.19489777
Proof Engine. "Claim Verification: “All ultra-processed foods are inherently unhealthy and should be avoided completely.” — Disproved." 2026. https://doi.org/10.5281/zenodo.19489777.
@misc{proofengine_all_ultra_processed_foods_are_inherently_unhealthy,
  title   = {Claim Verification: “All ultra-processed foods are inherently unhealthy and should be avoided completely.” — Disproved},
  author  = {{Proof Engine}},
  year    = {2026},
  url     = {https://proofengine.info/proofs/all-ultra-processed-foods-are-inherently-unhealthy/},
  note    = {Verdict: DISPROVED. Generated by proof-engine v1.0.0},
  doi     = {10.5281/zenodo.19489777},
}
TY  - DATA
TI  - Claim Verification: “All ultra-processed foods are inherently unhealthy and should be avoided completely.” — Disproved
AU  - Proof Engine
PY  - 2026
UR  - https://proofengine.info/proofs/all-ultra-processed-foods-are-inherently-unhealthy/
N1  - Verdict: DISPROVED. Generated by proof-engine v1.0.0
DO  - 10.5281/zenodo.19489777
ER  -
View proof source 380 lines · 18.0 KB

This is the exact proof.py that was deposited to Zenodo and runs when you re-execute via Binder. Every fact in the verdict above traces to code below.

"""
Proof: All ultra-processed foods are inherently unhealthy and should be avoided completely.
Generated: 2026-03-28

Claim type: Compound qualitative claim — two sub-claims joined by AND.
Proof direction: DISPROVE (both sub-claims).

SC1: "All ultra-processed foods are inherently unhealthy" — universal claim,
     disprovable by counterexample or by authoritative rejection of the universal framing.
SC2: "Should be avoided completely" — absolute recommendation claim,
     disprovable by showing major health bodies recommend reduction, not elimination.
"""
import json
import sys
import os

PROOF_ENGINE_ROOT = os.environ.get("PROOF_ENGINE_ROOT")
if not PROOF_ENGINE_ROOT:
    _d = os.path.dirname(os.path.abspath(__file__))
    while _d != os.path.dirname(_d):
        if os.path.isdir(os.path.join(_d, "proof-engine", "skills", "proof-engine", "scripts")):
            PROOF_ENGINE_ROOT = os.path.join(_d, "proof-engine", "skills", "proof-engine")
            break
        _d = os.path.dirname(_d)
    if not PROOF_ENGINE_ROOT:
        raise RuntimeError("PROOF_ENGINE_ROOT not set and skill dir not found via walk-up from proof.py")
sys.path.insert(0, PROOF_ENGINE_ROOT)
from datetime import date

from scripts.verify_citations import verify_all_citations, build_citation_detail
from scripts.computations import compare

# ---------------------------------------------------------------------------
# 1. CLAIM INTERPRETATION (Rule 4)
# ---------------------------------------------------------------------------
CLAIM_NATURAL = (
    "All ultra-processed foods are inherently unhealthy and should be avoided completely."
)
CLAIM_FORMAL = {
    "subject": "Ultra-processed foods (NOVA Group 4 classification)",
    "proof_direction": "disprove",
    "sub_claims": [
        {
            "id": "SC1",
            "property": (
                "Every food classified as ultra-processed (NOVA Group 4) is inherently harmful "
                "regardless of context, quantity, or individual nutrient composition"
            ),
            "operator": ">=",
            "threshold": 3,
            "proof_direction": "disprove",
            "operator_note": (
                "'All UPFs are inherently unhealthy' is a universal claim: every NOVA Group 4 "
                "food is harmful by its nature. Logically, one credible counterexample disproves "
                "a universal. Threshold set to 3 (≥3 independent authoritative sources that "
                "explicitly reject this universal framing or identify UPFs acceptable in a healthy "
                "diet) to require genuine multi-source consensus, not isolated dissent."
            ),
        },
        {
            "id": "SC2",
            "property": (
                "Authoritative health bodies recommend complete avoidance of all ultra-processed foods "
                "(i.e., no UPF should ever be consumed by anyone)"
            ),
            "operator": ">=",
            "threshold": 3,
            "proof_direction": "disprove",
            "operator_note": (
                "'Should be avoided completely' is read as an absolute, context-free recommendation. "
                "To disprove it, we need ≥3 independent authoritative health bodies or peer-reviewed "
                "sources whose actual guidance is reduction or limitation — not elimination — and/or "
                "that explicitly allow some UPFs in a healthy diet. "
                "If major health bodies consistently say 'eat less,' 'limit,' or 'some UPFs can be "
                "included in a healthy diet,' the absolute avoidance claim is refuted."
            ),
        },
    ],
    "compound_operator": "AND",
    "operator_note": (
        "The original claim is compound: (SC1 AND SC2). Both must hold for the claim to be true. "
        "To disprove the compound AND claim, disproving either SC1 or SC2 is logically sufficient. "
        "This proof disproves both sub-claims independently."
    ),
}

# ---------------------------------------------------------------------------
# 2. FACT REGISTRY
# ---------------------------------------------------------------------------
FACT_REGISTRY = {
    "B1": {"key": "sc1_nhs",     "label": "SC1: NHS — explicitly names UPFs acceptable in a healthy diet"},
    "B2": {"key": "sc1_harvard", "label": "SC1: Harvard T.H. Chan Nutrition Source — some UPFs may be useful"},
    "B3": {"key": "sc1_gibney",  "label": "SC1: Gibney 2019 (Curr Dev Nutr) — no good/bad foods, only diets"},
    "B4": {"key": "sc2_nhs",     "label": "SC2: NHS — recommends 'eating less' not complete avoidance"},
    "B5": {"key": "sc2_who",     "label": "SC2: WHO Healthy Diet fact sheet — 'limit' not 'avoid completely'"},
    "B6": {"key": "sc2_harvard", "label": "SC2: Harvard — UPF use is consumer choice, pros and cons"},
    "A1": {"label": "SC1 verified disproof source count", "method": None, "result": None},
    "A2": {"label": "SC2 verified disproof source count", "method": None, "result": None},
}

# ---------------------------------------------------------------------------
# 3. EMPIRICAL FACTS
#    SC1 keys: sources that reject "all UPFs are inherently unhealthy"
#    SC2 keys: sources that use reduction language, not complete-avoidance language
#    Adversarial sources (supporting the claim) go in adversarial_checks only.
# ---------------------------------------------------------------------------
empirical_facts = {
    # --- SC1 disproof ---
    "sc1_nhs": {
        "quote": (
            "Some ultra-processed foods can be included in a healthy diet "
            "\u2013 such as wholemeal sliced bread, wholegrain or higher fibre "
            "breakfast cereals or baked beans."
        ),
        "url": "https://www.nhs.uk/live-well/eat-well/how-to-eat-a-balanced-diet/what-are-processed-foods/",
        "source_name": "NHS (UK National Health Service) \u2014 What are processed foods?",
    },
    "sc1_harvard": {
        "quote": "some products may be a useful addition to a healthful diet",
        "url": "https://nutritionsource.hsph.harvard.edu/processed-foods/",
        "source_name": (
            "Harvard T.H. Chan School of Public Health \u2014 "
            "The Nutrition Source: Processed Foods"
        ),
    },
    "sc1_gibney": {
        "quote": "there are good and bad diets, not good and bad foods",
        "url": "https://pmc.ncbi.nlm.nih.gov/articles/PMC6389637/",
        "source_name": (
            "Gibney MJ (2019), Ultra-Processed Foods: Definitions and Policy Issues, "
            "Current Developments in Nutrition, PMC6389637"
        ),
    },
    # --- SC2 disproof ---
    "sc2_nhs": {
        "quote": (
            "Most people would probably benefit from eating less ultra-processed foods "
            "that are high in saturated fat, salt or sugar."
        ),
        "url": "https://www.nhs.uk/live-well/eat-well/how-to-eat-a-balanced-diet/what-are-processed-foods/",
        "source_name": "NHS (UK National Health Service) \u2014 What are processed foods?",
    },
    "sc2_who": {
        "quote": "Foods high in unhealthy fats, free sugars and sodium should be limited.",
        "url": "https://www.who.int/news-room/fact-sheets/detail/healthy-diet",
        "source_name": "World Health Organization \u2014 Healthy Diet Fact Sheet",
    },
    "sc2_harvard": {
        "quote": (
            "the use of processed and even ultra-processed foods is the choice of the consumer, "
            "and there are pros and cons that come with each type"
        ),
        "url": "https://nutritionsource.hsph.harvard.edu/processed-foods/",
        "source_name": (
            "Harvard T.H. Chan School of Public Health \u2014 "
            "The Nutrition Source: Processed Foods"
        ),
    },
}

# ---------------------------------------------------------------------------
# 4. CITATION VERIFICATION (Rule 2)
# ---------------------------------------------------------------------------
citation_results = verify_all_citations(empirical_facts, wayback_fallback=True)

# ---------------------------------------------------------------------------
# 5. COUNT VERIFIED SOURCES PER SUB-CLAIM
# ---------------------------------------------------------------------------
SC1_KEYS = ["sc1_nhs", "sc1_harvard", "sc1_gibney"]
SC2_KEYS = ["sc2_nhs", "sc2_who", "sc2_harvard"]
COUNTABLE_STATUSES = ("verified", "partial")

n_sc1 = sum(1 for k in SC1_KEYS if citation_results[k]["status"] in COUNTABLE_STATUSES)
n_sc2 = sum(1 for k in SC2_KEYS if citation_results[k]["status"] in COUNTABLE_STATUSES)

print(f"  SC1 confirmed sources: {n_sc1} / {len(SC1_KEYS)}")
print(f"  SC2 confirmed sources: {n_sc2} / {len(SC2_KEYS)}")

# ---------------------------------------------------------------------------
# 6. CLAIM EVALUATION — MUST use compare(), never hardcode (Rule 7)
# ---------------------------------------------------------------------------
sc1_threshold = CLAIM_FORMAL["sub_claims"][0]["threshold"]
sc2_threshold = CLAIM_FORMAL["sub_claims"][1]["threshold"]

sc1_disproved = compare(
    n_sc1, ">=", sc1_threshold,
    label="SC1 disproof: verified sources rejecting 'all UPFs inherently unhealthy'"
)
sc2_disproved = compare(
    n_sc2, ">=", sc2_threshold,
    label="SC2 disproof: verified sources rejecting 'should be avoided completely'"
)

# Compound AND claim: disproved if EITHER sub-claim is disproved.
# We expect both to be disproved.
compound_disproved = sc1_disproved or sc2_disproved
both_disproved = sc1_disproved and sc2_disproved

# ---------------------------------------------------------------------------
# 7. ADVERSARIAL CHECKS (Rule 5)
#    Searching for evidence that SUPPORTS the original claim.
# ---------------------------------------------------------------------------
adversarial_checks = [
    {
        "question": (
            "Do any major health authorities support complete avoidance of all UPFs?"
        ),
        "verification_performed": (
            "Searched for 'WHO ultra-processed foods avoid completely,' "
            "'NHS avoid all ultra-processed foods,' "
            "'USDA dietary guidelines ultra-processed avoid completely,' "
            "and reviewed Brazil 2014 Dietary Guidelines (origin of NOVA classification). "
            "Also checked AAP (American Academy of Pediatrics) infant formula guidance."
        ),
        "finding": (
            "No major health authority (WHO, NHS, CDC, USDA, AAP, BNF) recommends complete "
            "avoidance of all UPFs. Brazil's 2014 Dietary Guidelines say 'Avoid ultra-processed "
            "foods' but this is primarily a cultural/culinary preference statement and is "
            "explicitly contested by other nutrition bodies. The AAP continues to recommend "
            "infant formula (NOVA Group 4) for infants who cannot breastfeed, directly "
            "contradicting any universal avoidance directive."
        ),
        "breaks_proof": False,
    },
    {
        "question": (
            "Do observational studies show ALL UPF consumption is harmful, even at low levels?"
        ),
        "verification_performed": (
            "Reviewed Rico-Campà et al. (BMJ 2019, PMC6538973) — largest-cited UPF mortality "
            "cohort study. Searched for 'ultra-processed food dose-response mortality low "
            "consumption' and 'ultra-processed food health benefit study.' "
            "Also reviewed Elizabeth et al. (Nutrients 2020, PMC7399967) systematic review."
        ),
        "finding": (
            "Rico-Campà et al. (BMJ 2019) found higher all-cause mortality in the highest "
            "quartile (≥4 servings/day) vs lowest quartile — a dose-dependent, not absolute, "
            "association. The lowest-quartile group had best outcomes while still consuming "
            "some UPFs. Authors explicitly note inability to rule out residual confounding. "
            "Elizabeth et al. (Nutrients 2020) reviewed 43 studies; all associations were at "
            "population/dietary-pattern level, not individual-product level. No peer-reviewed "
            "study demonstrates that any dose of any UPF is inherently harmful."
        ),
        "breaks_proof": False,
    },
    {
        "question": (
            "Is the NOVA 'ultra-processed' category scientifically coherent enough to support "
            "a universal health claim?"
        ),
        "verification_performed": (
            "Searched 'NOVA classification criticism reliability,' 'ultra-processed food "
            "definition controversy,' and reviewed Gibney 2019 (PMC6389637). "
            "Checked whether infant formula is classified as UPF under NOVA."
        ),
        "finding": (
            "Gibney 2019 (PMC6389637) documents that NOVA classifies all commercially produced "
            "infant formula as ultra-processed and 'to be avoided,' yet 'no study has been "
            "undertaken to explore the implications of such a policy for this vulnerable group.' "
            "Harvard Nutrition Source states 'NOVA has been criticized for being too general in "
            "classifying certain foods, causing confusion.' The NOVA Group 4 category spans diet "
            "sodas, iron-fortified infant cereals, wholemeal sliced bread, and infant formula — "
            "a heterogeneous group that undermines any universal health claim."
        ),
        "breaks_proof": False,
    },
    {
        "question": (
            "Do NOVA originators themselves claim all UPFs are 'inherently' harmful?"
        ),
        "verification_performed": (
            "Reviewed Monteiro et al. 2018 NOVA food classification paper and PAHO/WHO-aligned "
            "guidance. Searched 'Monteiro ultra-processed inherently unhealthy.'"
        ),
        "finding": (
            "NOVA proponents (Monteiro et al.) argue that processing itself may cause harm "
            "beyond nutrient composition and advocate strong policy restrictions. However, "
            "their peer-reviewed papers phrase findings as population-level associations, "
            "not absolute per-food determinations. The 'inherently unhealthy' framing — "
            "implying harm regardless of quantity or context — exceeds what even the strongest "
            "pro-NOVA researchers assert in the literature."
        ),
        "breaks_proof": False,
    },
]

# ---------------------------------------------------------------------------
# 8. VERDICT AND STRUCTURED OUTPUT
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    any_unverified = any(
        citation_results[k]["status"] != "verified"
        for k in list(SC1_KEYS) + list(SC2_KEYS)
    )
    any_breaks = any(ac.get("breaks_proof") for ac in adversarial_checks)

    if any_breaks:
        verdict = "UNDETERMINED"
    elif compound_disproved and not any_unverified:
        verdict = "DISPROVED"
    elif compound_disproved and any_unverified:
        verdict = "DISPROVED (with unverified citations)"
    else:
        verdict = "UNDETERMINED"

    FACT_REGISTRY["A1"]["method"] = f"count(SC1 verified disproof citations >= {sc1_threshold})"
    FACT_REGISTRY["A1"]["result"] = str(n_sc1)
    FACT_REGISTRY["A2"]["method"] = f"count(SC2 verified disproof citations >= {sc2_threshold})"
    FACT_REGISTRY["A2"]["result"] = str(n_sc2)

    citation_detail = build_citation_detail(FACT_REGISTRY, citation_results, empirical_facts)

    # Extractions: for qualitative proofs, record citation verification status
    extractions = {}
    for fid, info in FACT_REGISTRY.items():
        if not fid.startswith("B"):
            continue
        ef_key = info["key"]
        cr = citation_results.get(ef_key, {})
        extractions[fid] = {
            "value": cr.get("status", "unknown"),
            "value_in_quote": cr.get("status") in COUNTABLE_STATUSES,
            "quote_snippet": empirical_facts[ef_key]["quote"][:80],
        }

    summary = {
        "fact_registry": {
            fid: {k: v for k, v in info.items()}
            for fid, info in FACT_REGISTRY.items()
        },
        "claim_formal": CLAIM_FORMAL,
        "claim_natural": CLAIM_NATURAL,
        "citations": citation_detail,
        "extractions": extractions,
        "cross_checks": [
            {
                "description": "SC1 disproof: multiple independent authoritative sources consulted",
                "n_sources_consulted": len(SC1_KEYS),
                "n_sources_verified": n_sc1,
                "sources": {k: citation_results[k]["status"] for k in SC1_KEYS},
                "independence_note": (
                    "NHS (UK government health body), Harvard T.H. Chan (US academic), "
                    "Gibney 2019 in peer-reviewed journal (Current Developments in Nutrition) "
                    "— independent institutions across different countries and sectors."
                ),
            },
            {
                "description": "SC2 disproof: multiple independent authoritative sources consulted",
                "n_sources_consulted": len(SC2_KEYS),
                "n_sources_verified": n_sc2,
                "sources": {k: citation_results[k]["status"] for k in SC2_KEYS},
                "independence_note": (
                    "NHS (UK), WHO (international UN agency), Harvard T.H. Chan (US academic) "
                    "— three independent institutions across jurisdictions and sectors."
                ),
            },
        ],
        "adversarial_checks": adversarial_checks,
        "verdict": verdict,
        "key_results": {
            "sc1_n_confirmed": n_sc1,
            "sc1_threshold": sc1_threshold,
            "sc1_disproved": sc1_disproved,
            "sc2_n_confirmed": n_sc2,
            "sc2_threshold": sc2_threshold,
            "sc2_disproved": sc2_disproved,
            "both_sub_claims_disproved": both_disproved,
            "compound_claim_disproved": compound_disproved,
        },
        "generator": {
            "name": "proof-engine",
            "version": open(os.path.join(PROOF_ENGINE_ROOT, "VERSION")).read().strip(),
            "repo": "https://github.com/yaniv-golan/proof-engine",
            "generated_at": date.today().isoformat(),
        },
    }

    print("\n=== PROOF SUMMARY (JSON) ===")
    print(json.dumps(summary, indent=2, default=str))

↓ download proof.py · view on Zenodo (immutable)

Re-execute this proof

The verdict above is cached from when this proof was minted. To re-run the exact proof.py shown in "View proof source" and see the verdict recomputed live, launch it in your browser — no install required.

Re-execute the exact bytes deposited at Zenodo.

Re-execute in Binder runs in your browser · ~60s · no install

First run takes longer while Binder builds the container image; subsequent runs are cached.

machine-readable formats

Jupyter Notebook interactive re-verification W3C PROV-JSON provenance trace RO-Crate 1.1 research object package
Downloads & raw data

found this useful? ★ star on github