Start with your source code. Open a statement, inspect the compiler’s decisions and follow the facts behind them. panack explain helps you understand why code passed a check—or why the compiler could not accept it.
This is static analysis. It checks your program without running it. It does not pause execution or display runtime variable values.
This opens the interactive explorer for remaining. Statements appear in source order. The compilation result tells you whether the project was accepted; the source view lets you choose what to investigate.
The command checks the whole project even when you select one function. Large projects can take time to open.
2. Follow a decision to its evidence.
Use Up and Down to select the source statement containing n - 2.
Press Enter to see the compiler decisions associated with that statement.
Select the subtraction decision and press Enter to inspect the explanation. The compiler must establish that subtracting two cannot take n below zero.
Follow the supporting source with Enter when offered. The relevant fact comes from n >= 2 in the enclosing condition.
Press Left to return to your previous selection, or q to quit.
The subtraction explanation in the released alpha.15 explorer, using this example. Captured terminal output; select the image to open it at full size. Press Enter in the explorer to follow the supporting condition.
The useful part is the connection: the subtraction is accepted because this branch establishes the bound it needs. You can see which condition the proof depends on, rather than just knowing that the program compiled.
3. See what changes when the proof fails.
Quit the explorer and change n - 2 to n - 3. Keep the condition n >= 2, then run the same explanation command again.
The project is now rejected. Press n to jump to the first rejected or unproved decision, then open it. The branch establishes a minimum of two, but the subtraction needs at least three. When n is two, the result would be negative.
If subtracting three is your intention, change the condition to n >= 3 and reopen the explorer. If the function should subtract only two, restore n - 2. The explanation identifies the mismatch; you decide which behaviour is correct.
“Unproved” means the compiler could not establish safety. It does not mean the program was executed and failed.
Explore more than subtraction.
The explorer exposes function-checking decisions for types, arguments and return values, existing type inference, generic constraints, operators, conditions, pattern matching, collections, callbacks, guarded conversions and effects.
For validated domain types, inspect the requirement and follow the guard declaration that supplies it. When checking stops before a decision can be made, the explorer marks that decision unavailable and explains why. Parsing and name-resolution failures remain frontend diagnostics.
For an accepted project, you can also inspect the instructions generated for a statement and follow their source origins. These are compiler-generated instructions, not a trace of a running program. The explorer prepares them in memory.
A successful local check does not make the whole project valid. Read the compilation result alongside the individual decisions.
Plain reports when you need them.
Use --text to get a report rather than the terminal explorer. Piping the output also selects text mode.
For the original n - 2 program, the report includes this excerpt. This is plain report output, not the interactive screen:
Show the subtraction report excerpt
program: accepted
function: remaining
scope: Nat subtraction; generic definitions, not call-site specialisations
subtraction: proved
source: project/remaining.panack:3:5-3:10
expression: n - 2
operand types: Nat, Nat
obligation: left >= right
right constant: 2
left lower bound: 2
guard branch: true
source: project/remaining.panack:2:6-2:12
expression: n >= 2
reason: retained lower bound is at least the right constant
program: accepted describes the project. subtraction: proved describes this particular check.
Show a rejected effect check
Save this deliberately invalid program as report.panack. A pure function cannot call print, which has an effect:
The command exits with status 1, preserves the ordinary diagnostic on stderr and includes this explanation:
program: rejected
effect scope: local call and await boundaries; declarations and callable types, not transitive/runtime effects
effect boundary: rejected
source: project/report.panack:2:3-2:11
expression: print(1)
boundary: call
context: pure
callee: print
classification basis: builtin or constructor contract
callee effect: ordinary
awaited: no
reason: pure function cannot call impure function print
Changing pure report to report allows this call if printing is the intended behaviour.
Keep exploring.
This guide describes native alpha.16. The independently pinned browser playground does not provide the terminal explorer.