Published June 3, 2026 | Version v0.40.x
Software Open

alternative-intelligence-cp/nitpick: v0.40.x — Conditionals (if/else + the is ternary)

Authors/Creators

  • 1. Alternative Intelligence Liberation Platform

Description

Nitpick v0.40.x — Conditionals (if / else if / else + the is ternary)

The v0.40.x cycle hardened Nitpick's two conditional surfaces — the if/else if/else statement chain and the is (cond) : a : b inline value-ternary. All COND-DEC items (001–014) resolved across v0.40.0–v0.40.7.

Headline fix

A variable or borrow used only inside an is arm is no longer a false [unused-variable]. The warning and borrow analyses (warnings.cpp collectIdentifiers and borrow_checker.cpp checkExpression) now recurse through the ternary's condition and both arms.

Other bugs fixed

  • Mixed-width is PHI verification failure — an is whose two arms had different integer widths produced an ill-typed LLVM PHI; the narrower arm is now sign-extended to the common type first.
  • exit not treated as a branch terminator — dead code after an exit inside a branch now correctly flags [dead-code].

Diagnostics minted

  • ARIA-IS-001 — incompatible is arms.
  • ARIA-IF-001 — stray else / else if with no preceding if.
  • ARIA-IF-002 — assignment = used as a condition (suggests ==).
  • ARIA-IF-003if used in value position (points at is and pick+give); ratifies that if is a statement, never an expression.

Formal semantics

k-semantics/aria.k gains a native grammar production for the is ternary (is ( Exp ) : Exp : Exp with strict(1) so only the condition is forced) and two reduction rules selecting exactly one arm — modeling short-circuit directly.

Validation

  • Compiler CTest: 201/201
  • K core tests: 235/235 (adds 229–235 for the is ternary)
  • Bug regressions: bug951–bug990 (40 fixtures)
  • Docs: new guide/conditionals/ 8-chapter cookbook

Files

alternative-intelligence-cp/nitpick-v0.40.x.zip

Files (26.8 MB)

Name Size Download all
md5:db3b9e5bc245501255b16256c5edd4cd
26.8 MB Preview Download

Additional details

Related works