Program execution
Lax213208.Programs · concepts/Lax213208/Programs.lean · lax-213208
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
We use the archive's word-RAM programs. An output is returned if it is produced at every sufficiently large word width. This is an execution relation, not a computability claim or a running-time bound.
A resource bound guarantees that input words and length fit in bits, and that the same output is produced within instructions at every width at least . Lax62's compilation theorems establish the underlying judgment from high-level program specifications.
Concept map
Lean source view on GitHub
| 1 | import Lax808846.RamComputes |
| 2 | import Lax759944.RamPolytime |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: Program execution |
| 7 | type: definition |
| 8 | --- |
| 9 | We use the archive's word-RAM programs. An output is returned if it is |
| 10 | produced at every sufficiently large word width. This is an execution |
| 11 | relation, not a computability claim or a running-time bound. |
| 12 | |
| 13 | A resource bound guarantees that input words and length fit in bits, |
| 14 | and that the same output is produced within instructions at every |
| 15 | width at least . Lax62's compilation theorems establish the underlying |
| 16 | `ComputesInTime` judgment from high-level program specifications. |
| 17 | -/ |
| 18 | |
| 19 | namespace Lax213208.Programs |
| 20 | |
| 21 | open Lax808846.Ram Lax808846.RamComputes Lax759944.RamPolytime |
| 22 | |
| 23 | abbrev Program := Lax808846.Ram.Program |
| 24 | |
| 25 | def Returns (alg : Program) (input output : List ℕ) : Prop := |
| 26 | ∃ width : ℕ, ∀ w ≥ width, ∃ steps, RunsTo w alg input output steps |
| 27 | |
| 28 | def RunsWithin (alg : Program) (input output : List ℕ) (bound : ℕ) : Prop := |
| 29 | FitsInWords bound (input.length :: input) ∧ |
| 30 | ∀ w ≥ bound, ComputesInTime w alg {input} (fun _ => output) (fun _ => bound) |
| 31 | |
| 32 | end Lax213208.Programs |
| 33 |
From Mathlib
none
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments