AFTD Auto-Formalizing Theoretical Domains

instanceHorizon

def

The finite time horizon of a list of deadline requests, defined as one more than the maximum deadline, or zero if empty.

Statement

def instanceHorizon {α : Type*} (reqs : List (DeadlineRequest α)) : ℕ
Defined in
arXiv:2610.18767 Sec. 2
Verified
18 Oct 2026
Axioms
none listed
Built on 1
  • DeadlineRequestA request in online paging with deadlines, specifying a requested page in α, an arrival time in ℕ, and a deadline in ℕ with arrival ≤…
Used by 6

Read back from the Lean

For a type α and a list reqs of DeadlineRequest α, instanceHorizon reqs is the natural number defined as the right fold over reqs starting from 0 with the operation fun r m => max (r.deadline + 1) m. In other words, it is 0 if reqs is empty, and max_{r ∈ reqs} (r.deadline + 1) (one greater than the maximum deadline among all requests in reqs) if reqs is non-empty.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The time horizon of a list of deadline requests. -/
def instanceHorizon {α : Type*} (reqs : List (DeadlineRequest α)) : ℕ := reqs.foldr (fun r m => max (r.deadline + 1) m) 0
See it in the graphDiscuss this resultChallenge it