ReductionBounds.PortProtocol (ReductionBounds v0.1.0)

Copy Markdown View Source

An initial, supplied Port protocol model, not an analysis of Port-using code.

The caller is the Port owner and has at most one request in progress. Only rejected submissions can be retried; acceptance cannot be followed by another submission. Arrival and closure are environment observations with no owned work charge. Receiving, decoding, closure handling, and suspension handling are distinct caller-owned work events. Waiting itself is a state.

The model permits unfinished prefixes, repeated receive inspections, and rejected-submission retries. It imposes no count bounds or progress assumptions. Units are symbolic labels and do not identify ERTS reductions. External computation and port-side costs are not inferred or bounded.

:timeout_elapsed represents an application receive-timeout observation while awaiting a response, followed by caller-owned :handle_timeout. It is not a timeout option for port command submission and cannot interrupt a suspended submission. :decode_error is a distinct terminal outcome. Conditional completion requires separate progress and finite-loop conditions; neither an accepted command nor a cost bound establishes response arrival.

Summary

Functions

Builds explicit conditions for the initial Port model.

Functions

conditions(options)

@spec conditions(keyword()) ::
  {:ok, ReductionBounds.ProtocolConditions.t()} | {:error, term()}

Builds explicit conditions for the initial Port model.

Supply finite data_bounds for :request, :response, and :message, and count_bounds for :total_events, :submission_attempts, :submission_events, :resumptions, :retries, and :receive_inspections. Inspection counts include the matching response. Submission outcomes after resumption add work events but do not begin another submission attempt.

Optional integer_events associates event names with integer-condition names in integer_bounds. These associations are user-supplied conditions, not a proof of request encoding or response decoding.

new()

@spec new() :: {:ok, ReductionBounds.Protocol.Contract.t()} | {:error, term()}