Documentation

CslibFrontier.DataStructure.OrderedSet.Spec

A representation-independent stateful ordered set #

The abstract state is a finite set over any linear order. Membership, insertion, deletion, minimum and strict successor have operation-dependent result types. All operations are admissible, including empty queries, duplicate insertion and deletion of absent keys. A bounded-key implementation can specialize spec.valid for insertion while preserving arbitrary membership and successor queries. This module does not choose a representation or charge a computational cost.

Main definitions #

References #

The adaptive client syntax uses Quang Dao's upstream free monad via Cslib.DataStructure.StateTransitionSpec.

Typed finite-set operations, independent of any representation.

  • contains {α : Type} (key : α) : Op α
  • insert {α : Type} (key : α) : Op α
  • delete {α : Type} (key : α) : Op α
  • minimum {α : Type} : Op α
  • successor {α : Type} (key : α) : Op α
def Cslib.DataStructure.OrderedSet.instDecidableEqOp.decEq {α✝ : Type} [DecidableEq α✝] (x✝ x✝¹ : Op α✝) :
Decidable (x✝ = x✝¹)
@[instance_reducible]
@[reducible, inline]

Return type for each Op α.

@[reducible, inline]
abbrev Cslib.DataStructure.OrderedSet.step {α : Type} [LinearOrder α] (s : Finset α) (o : Op α) :

Pure transition function for ordered-set operations.

@[reducible, inline]

Mathematical ordered-set semantics. All operations are admissible, including empty queries.