# `Spectre.Execution.Expression`
[🔗](https://github.com/elchemista/spectre/blob/0.4.0/lib/spectre/execution/expression.ex#L1)

Closed expression language used by data-driven execution programs.

Expressions can read the immutable Work input, current state, or last
operation result; embed a portable literal; and assemble maps or lists.
They never contain callbacks, modules, quoted code, or arbitrary MFAs.

# `t`

```elixir
@type t() :: map()
```

# `evaluate`

```elixir
@spec evaluate(t(), map()) :: {:ok, term()} | {:error, term()}
```

Evaluates a normalized expression against a reduced data environment.

# `normalize`

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

Normalizes one authored expression into its canonical closed form.

# `put`

```elixir
@spec put(term(), [String.t() | non_neg_integer()], term()) ::
  {:ok, term()} | {:error, term()}
```

Writes a value at a closed map/list path without creating atoms.

# `state_path`

```elixir
@spec state_path(term()) :: {:ok, [String.t() | non_neg_integer()]} | {:error, term()}
```

Normalizes a non-empty state path.

---

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