Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.28 KB

File metadata and controls

38 lines (26 loc) · 1.28 KB

priority task scheduler

Language: Python · Sphere: programming · Category: Data Structures

Signature: () → None

What it does

Priority Queue Scheduler Module

This module implements a priority queue scheduler that handles tasks with different priorities and deadlines. Tasks are ordered first by priority, then by deadline, and finally by insertion order for stability.

Guarantee

When it runs, priority task scheduler guarantees s.size() == 4; [t.id for t in top2] == ['b', 'a'] and s.size() == 2; s.get_next_task().id == 'b' and s.size() == 2 (proven by run).

Checkable constraints:

  • s.size() == 4
  • order == ['p1_soon', 'p1_late', 'mid', 'low']
  • s.pop_next_task() is None and s.is_empty()
  • [s.pop_next_task().id for _ in range(3)] == ['first', 'second', 'third']
  • [t.id for t in top2] == ['b', 'a'] and s.size() == 2
  • s.get_next_task().id == 'b' and s.size() == 2
  • s.remove_task('b') is True
  • s.remove_task('b') is False

Verification evidence

  • Green-run: ✓ passes (re-run under the extractor's gate)
  • Constraint strength: recovery (truth-pinned)
  • Independent oracle: — none yet (green-run candidate; not an axiom under the frozen ruler)
  • Peer review: unreviewed

△ AURA Pattern Library — © Reality Optimizer