# `ReductionBounds.MailboxMatch`
[🔗](https://github.com/zacky1972/reduction_bounds/blob/v0.1.0/lib/reduction_bounds/mailbox_match.ex#L1)

Ordered patterns and a restricted guard language for supplied mailbox models.

Patterns: `:any`, `:pid`, `{:literal, reified_term}` and recursive
`:tuple2`, `:tuple3`, `:tuple5`, `:cons` patterns. Guards: `true`, `false`,
`{:is_integer, path}`, `{:integer_le | :integer_ge, path, bound}`.
Paths use zero-based tuple fields or cons head/tail. No callbacks, arbitrary
guards or native receive optimizations are assumed. Attempts count clauses,
not machine instructions; the complete finite matching program is retained.

# `clause`

```elixir
@type clause() :: %{
  kind: :reply | :peer_down | :other,
  pattern: term(),
  guard: term()
}
```

# `choose`

```elixir
@spec choose([clause()], ReductionBounds.RpcTerm.t()) ::
  {non_neg_integer() | nil, non_neg_integer(), non_neg_integer()}
```

# `evaluate_guard`

```elixir
@spec evaluate_guard(term(), ReductionBounds.RpcTerm.t()) :: boolean()
```

# `guard?`

```elixir
@spec guard?(term()) :: boolean()
```

# `matches?`

```elixir
@spec matches?(term(), ReductionBounds.RpcTerm.t()) :: boolean()
```

# `pattern?`

```elixir
@spec pattern?(term()) :: boolean()
```

# `validate`

```elixir
@spec validate(term()) :: :ok | {:error, term()}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
