Sound and complete blocks of nondeterministic counter code #
Compositional reasoning for nondeterministic counter programs whose choice bit is register 0.
Block.Sound P w B Post l regs T G says that every branch from label l, with registers regs
above the choice, halts in a configuration satisfying Post or reaches label T with registers
satisfying G, keeping all registers at most B. Block.Complete P w l regs T G says that,
whatever the current choice bit, some branch reaches T with registers satisfying G. Both
compose sequentially and absorb shifted deterministic code; guessCode guesses a register value
below a bound.
Main definitions #
Turing.CounterProgram.Block.Sound,Turing.CounterProgram.Block.Complete: block contracts.Turing.CounterProgram.Block.guessCode: nondeterministically guess a bounded value.
Main results #
Turing.CounterProgram.Block.Sound.bind,Turing.CounterProgram.Block.Complete.bind: sequential composition.Turing.CounterProgram.Block.Sound.guess,Turing.CounterProgram.Block.Complete.guess: the guessed value is any number below the bound.
Sound l regs T G: from the label l with the registers regs above the choice, every
branch halts satisfying Post or reaches the label T with registers satisfying G above the
choice, keeping its registers at most B.
Instances For
Complete l regs T G: from the label l with the registers regs above the choice, whatever
the choice, some branch reaches the label T with registers satisfying G above the choice.
Instances For
Transport an instruction fact along an equality of labels, for labels computed by omega.
Transport a code-placement fact along an equality of labels.
A halting label satisfying Post.
Oblivious deterministic code, above the choice.
Deterministic code placed by padded, shifted above the choice.
A choice: the label yes on the choice false, and no on true.
Oblivious deterministic code, above the choice.
Deterministic code placed by padded, shifted above the choice.
A step of deterministic code into a choice, then the branch of either label.
Every branch of a guess reaches E with a value below N, or rejects.
Some branch of a guess reaches E with any value below N.