Logic Error

Domain: Code Generation

🎯 Motivation

Code runs without crashing but produces wrong results. Harder to find than syntax errors. The model can help debug.

πŸ“‹ Concrete Example

Code: β€˜def average(a, b): return a + b / 2’ (missing parentheses). Returns 4.0 instead of 3.0 for average(2, 4). Logic error: should be (a + b) / 2.

πŸ”— Analogy

A recipe with a wrong step - β€˜add 2 cups of salt instead of sugar.’ The cake bakes fine but tastes terrible. Logic errors produce wrong results without crashing.