# `Feel.Type.Recursive`
[🔗](https://github.com/FeeJai/BDM/blob/feel-v0.1.0/apps/feel/lib/feel/type/recursive.ex#L1)

Finite graphs for guarded recursive item declarations.

Runtime unfolding retains references and checks every finite value. Analysis uses an upper
approximation, never a proof that a recursive target is satisfied. Cycles without a context
member or list element, and cycles through function signatures, are rejected by `validate/2`.
Finite function items may accept or return recursive data. Relations between different recursive
descriptors remain conservative; a structural analysis projection is not runtime signature evidence.

# `graph`

```elixir
@type graph() :: %{
  optional(String.t()) =&gt; %{
    type: term(),
    constraints: list(),
    recursive?: boolean(),
    resolved_type: Feel.Type.t() | nil
  }
}
```

# `t`

```elixir
@type t() :: {:recursive, String.t(), graph()}
```

# `contains?`

```elixir
@spec contains?(Feel.Type.t()) :: boolean()
```

Whether a type contains a recursive declaration, without unfolding its graph.

# `equivalent?`

```elixir
@spec equivalent?(t(), t()) :: boolean()
```

Whether two descriptors have identical reachable declaration graphs up to renaming.

Import frames can rename references and include unrelated definitions. Compare the rooted
graphs with a consistent one-to-one renaming, retaining constructors, constraints and sharing.
This does not prove subtyping between different recursive shapes or unfold aliases away.

# `parts`

```elixir
@spec parts(Feel.Value.t(), String.t(), String.t(), graph()) :: [
  {Feel.Value.t(), list()}
]
```

Materializes occurrences of a declaration, with their concrete paths from the root.
Runtime constraint verification traverses incrementally instead: collecting every forward path
can require quadratic space for a deep chain.

# `unfold`

```elixir
@spec unfold(t()) :: Feel.Type.t()
```

Unfolds one graph node, retaining references as finite recursive descriptors.

# `upper`

```elixir
@spec upper(Feel.Type.t()) :: Feel.Type.t()
```

A structural upper approximation, bounded by repeated references and a shared node budget.

---

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