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.