ShotTx.Prover.FormulaPqueue (ShotTx v0.0.1)

Copy Markdown View Source

Min-priority queue for tableau formulas, backed by :gb_trees.

Elements are bucketed by integer cost; within the same cost bucket they are served FIFO. The cost is supplied by the caller (see Rules.rule_cost/1).

Summary

Functions

Returns true if the queue contains no elements.

Inserts element at the given cost. Equal-cost elements are served FIFO.

Returns an empty priority queue.

Removes and returns the lowest-cost element together with the updated queue.

Types

Functions

empty?(pqueue)

@spec empty?(t()) :: boolean()

Returns true if the queue contains no elements.

insert(pqueue, element, cost)

@spec insert(t(), element :: term(), cost :: non_neg_integer()) :: t()

Inserts element at the given cost. Equal-cost elements are served FIFO.

new()

@spec new() :: t()

Returns an empty priority queue.

take_smallest(pqueue)

@spec take_smallest(t()) :: {element :: term(), t()}

Removes and returns the lowest-cost element together with the updated queue.