v0.13.2Control flow and dataflow are rebuilt on explicit semantics, Z3 translation matches executable C# numeric rules, and the build chain is hermetic and supply-chain verified with hash- and size-pinned Z3 binaries.See what's new

Comprehension

Category: Comprehension v0.12 result: Calor wins (1.84x across 217 programs) What it measures: Structural clarity and semantic extractability


Overview

The Comprehension metric measures how easily an AI agent can understand code structure and extract semantic information without deep analysis.


Why It Matters

When an AI agent reads code, it needs to answer:

  • What are the function boundaries?
  • What are the inputs and outputs?
  • What side effects are possible?
  • What constraints must hold?

Traditional languages require parsing and inference. Calor makes these explicit.


How It's Measured

Calor Clarity Factors

FactorPointsCheck
Module declaration0.15Contains §M{
Function declaration0.15Contains §F{
Input parameters0.10Contains §I{
Output type0.10Contains §O{
Return statement0.10Contains §R
Effect declaration0.15Contains §E{
Requires contract0.15Contains §Q
Ensures contract0.10Contains §S
Indented body line (proportional)up to 0.10Matches ^[ \t]+\S
Indent-form completeness0.05At least one indented body line per §F{ opener

C# Clarity Factors

FactorPointsCheck
Namespace0.15Contains namespace
Class0.10Contains class
Public modifier0.05Contains public
Private modifier0.05Contains private
Return statement0.10Contains return
XML documentation0.20Contains ///
Comments0.05Contains //
Type annotations0.10Contains int , string , etc.
Code Contracts0.15Contains Contract. or Debug.Assert

Example Comparison

Calor (High Clarity)

Plain Text
§M{m001:Calculator}
  §F{f001:Divide:pub}
    §I{i32:a}
    §I{i32:b}
    §O{i32}
    §Q (!= b 0)
    §S (>= result 0)
    §R (/ a b)

Score calculation:

  • §M{: +0.15
  • §F{: +0.15
  • §I{: +0.10
  • §O{: +0.10
  • §R: +0.10
  • §Q: +0.15
  • §S: +0.10
  • Indented body lines: +0.10 (proportional)
  • Indent-form completeness (every §F{ has an indented body): +0.05

Total: 1.00

C# (Lower Clarity)

C#
namespace Calculator
{
    public static class Program
    {
        public static int Divide(int a, int b)
        {
            if (b == 0) throw new ArgumentException();
            var result = a / b;
            Debug.Assert(result >= 0);
            return result;
        }
    }
}

Score calculation:

  • namespace: +0.15
  • class: +0.10
  • public: +0.05
  • return: +0.10
  • int : +0.10
  • Debug.Assert: +0.15

Total: 0.65

Illustrative ratio: 0.95 / 0.65 = 1.46x. This single example is not the aggregate v0.12 result.


What Agents Can Extract

From Calor (Direct Extraction)

InformationExtraction Method
Function nameParse §F{id:name:vis}
Function IDParse §F{id:name:vis}
InputsFind all §I{type:name}
Output typeParse §O{type}
Side effectsParse §E{codes}
PreconditionsFind all §Q condition
PostconditionsFind all §S condition
Scope boundaries§F{id} opener followed by indented body lines (terminated by dedent in indent form)

From C# (Requires Inference)

InformationExtraction Method
Function nameParse method declaration
InputsParse parameter list
Output typeParse return type
Side effectsAnalyze all statements for I/O
PreconditionsFind throw statements, Debug.Assert
PostconditionsFind assertions near return
Scope boundariesCount and match braces

Real-World Impact

Agent Task: "What are the constraints on the Divide function?"

From Calor:

Plain Text
Preconditions: b != 0
Postconditions: result >= 0

Direct extraction from §Q and §S.

From C#:

Plain Text
Must analyze:
1. Exception throws (if (b == 0) throw...)
2. Debug.Assert calls
3. Comments (if any)
4. Infer from implementation

Interpretation

The v0.12 aggregate is 1.84x. Under this calculator, Calor source exposes more of the structural signals being counted. That measures the calculator's defined signals; it is not a direct measurement of human comprehension.

This doesn't mean C# is hard to understand—it means Calor makes structure more explicit, which benefits automated analysis.


Next