Theory Collections.PrioByAnnotatedList
section ‹\isaheader{Implementing Priority Queues by Annotated Lists}›
theory PrioByAnnotatedList
imports 
  "../spec/AnnotatedListSpec"
  "../spec/PrioSpec"
begin
text ‹
  In this theory, we implement priority queues by annotated lists.
  The implementation is realized as a generic adapter from the
  AnnotatedList to the priority queue interface.
  Priority queues are realized as a sequence of pairs of
  elements and associated priority. The monoids operation
  takes the element with minimum priority.
  The element with minimum priority is extracted from the
  sum over all elements.
  Deleting the element with minimum priority is done by
  splitting the sequence at the point where the minimum priority
  of the elements read so far becomes equal to the minimum priority of 
  all elements.
›
subsection "Definitions"
subsubsection "Monoid"