Determinism of source execution costs #
The same source statement and entry state determine its backend-derived count. Word width, call capacity and the proofs used to realize the execution do not affect that count. Source execution determinism aligns intermediate states and the actual callee final state and return before the structural cost rules are compared.
This result requires neither a machine representation nor positive word width. It compares existing cost observations and does not assert source termination.
theorem
Ram.LanguageCompiler.ExecutionCost.deterministic
{signatures : List Complexity.Language.Signature}
{program : Complexity.Language.Program signatures}
{w depth : ℕ}
{Γ : List Complexity.Language.Ty}
{result : Complexity.Language.Ty}
{stmt : Complexity.Language.Stmt signatures Γ result}
{entry finish : Complexity.Language.State Γ}
{control : Complexity.Language.Control result}
{execution : RealizedExec program w depth stmt entry finish control}
{steps : ℕ}
(first : ExecutionCost execution steps)
{w' depth' : ℕ}
{finish' : Complexity.Language.State Γ}
{control' : Complexity.Language.Control result}
{execution' : RealizedExec program w' depth' stmt entry finish' control'}
{steps' : ℕ}
:
ExecutionCost execution' steps' → steps = steps'
A deterministic source trace has one compiled core count, independently of word width, call capacity, final-state witnesses and realization proofs.